So I want my player to only be able to move forward and backwards not sidewards, for him to be able to move there I want him to have to rotate and then move forward. My current method to make him move is with AddForce but now I want if he turns right that the force gets converted to the right and not that he slides away to victory. I tried resetting the force to zero when the key for rotation is pressed but that wont help can I somehow convert the momentum to another direction?
hello, share your code for us to help you. how did you resetted the force? and how are you moving it?
the easiest solution without checking yoour code would be to changing the vector with something like this
public void ChangeDirection(bool inverseDirection)
{
Rigidbody rb = GetComponent<Rigidbody>();
if (inverseDirection) { rb.velocity = -rb.velocity; } // this will make the object change inverse direction
else { rb.velocity = new Vector3(rb.velocity.z, 0, rb.velocity.x); } // this will make the object change of axis
}