So I’m trying to make my player rotate toward the direction of movement and it kind of works, except along with rotating along the y axis toward the direction, the player immediately rotates on the x axis laying flat versus being upright.
This is the only code I’m using for rotation:
void Rotation()
{
Vector3 NextDir = new Vector3(Input.GetAxisRaw("Horizontal"), 0, Input.GetAxisRaw("Vertical"));
if (NextDir != Vector3.zero)
{
transform.rotation = Quaternion.LookRotation(NextDir);
}
}