Hi Andrew, sorry I've only just had a chance to attempt this, but not having any luck.Hm, yes I think I see what you mean now. I don't have a gamepad to test with right now, but I wonder if you could just modifydirection
based on the camera's current angle? E.g. if the camera is rotating about the Y axis, then you should be able to just add the camera's rotation to direction, something likedirection += m_Camera.transform.eulerAngles
.
I'm not quite sure how to 'place' that code, have tried the following:
// If the mouse hasn't moved then get the axis to determine a look rotation. This will be used for controllers and virtual input.
var direction = Vector3.zero;
direction += m_Camera.transform.eulerAngles;
direction.x = m_PlayerInput.GetAxis(m_PlayerInput.HorizontalLookInputName) + m_Camera.transform.eulerAngles.x;
direction.z = m_PlayerInput.GetAxis(m_PlayerInput.VerticalLookInputName) + m_Camera.transform.eulerAngles.z;
ALSO TRIED
// If the mouse hasn't moved then get the axis to determine a look rotation. This will be used for controllers and virtual input.
var direction = Vector3.zero;
direction.x = m_PlayerInput.GetAxis(m_PlayerInput.HorizontalLookInputName) + m_Camera.transform.eulerAngles.x;
direction.z = m_PlayerInput.GetAxis(m_PlayerInput.VerticalLookInputName) + m_Camera.transform.eulerAngles.z;
The result is the ANY right stick input makes Character face one direction only. I'm completely unsure how to use the line you suggested, whether it should replace something or where to place it!