- Home /
Player walks to the right?
So i'm using the Third Person Character (Ethan) as a placeholder for my game, and controlling him using two stick controllers. He seems to run straight and to the right in an endless circle when i move him forward. Does anyone know what may have caused this? Ill leave my edited code and picture below.
![private void FixedUpdate()
{
// read inputs
float h = CrossPlatformInputManager.GetAxisRaw("Horizontal");
float v = CrossPlatformInputManager.GetAxisRaw("Vertical");
float lh = CrossPlatformInputManager.GetAxisRaw("RightLeft");
float lv = CrossPlatformInputManager.GetAxisRaw("UpDown");
bool crouch = Input.GetKey(KeyCode.C);
lh /= lookspeed;
// calculate move direction to pass to character
if (m_Cam != null)
{
// calculate camera relative direction to move:
m_CamForward = Vector3.Scale(m_Cam.forward, new Vector3(1, 0, 1)).normalized;
m_Move = v * m_CamForward + lh * m_Cam.right;
//m_Move = v*m_CamForward + h*m_Cam.right;
}
else
{
// we use world-relative directions in the case of no main camera
m_Move = v*Vector3.forward + h*Vector3.right;
}]
If this doesnt make sense then feel free to let me know, or if you can also help with slowing down the sensitivity of the controllers that would be great as well. Thanks so much! [1]
[1]: /storage/temp/121079-screenshot-39.png
Your answer
Follow this Question
Related Questions
How can I fix my left and right movement which is currently affected by Cinemachine? 0 Answers
Third Person Control Based on Current Camera 0 Answers
Constraining a camera movement 0 Answers
Limiting camera movement (2d map) 2 Answers
Orbit around an object 0 Answers