- Home /
When Player rotates movement seems reversed.
Hey!
the code below shows how i get my character to move based on the joystick input. problem is that when the character rotates 360, the player seems to be moving in reverse. can someone help me out?
void Update()
{
//get movement from
velocity1 = new Vector3(joystick.Horizontal * 10f, rigidbody.velocity.y, joystick.Vertical * 10f);
rigidbody.velocity = velocity1;
}
Comment
Answer by Triggerly · May 18, 2020 at 02:58 PM
Try velocity = new Vector3(Input.GetAxisRaw("Horizontal"), 0, Input.GetAxisRaw("Vertical"));
or Go in Edit >> Project Settings >> Input, then select invert for Horizontal and Vertical. Hope this helps!
Your answer
Follow this Question
Related Questions
Move RigidBody character relative to camera. 2 Answers
Player Rotation is snapping 1 Answer
Camera Problem 1 Answer
Unity 2D Position Issues 0 Answers
Player rotates with camera(face same direction as the camera) 1 Answer