I’m using a sphere for a player and using rigidbody.AddForce to move it around, and the rotation is generated by friction with the ground. Unfortunately, its rotation isn’t matching its movement, and at higher speeds it seems to be rotating at about the third of the speed it should be.
This is the base of my movement code:
float speed = 24;
void FixedUpdate()
{
Vector3 camF = new Vector3(transform.position.x - camera.transform.position.x, 0, transform.position.z - camera.transform.position.z).normalized;
Vector3 camR = camera.transform.TransformDirection(Vector3.right);
rigidbody.AddForce(camF * Input.GetAxis("Vertical") * speed);
rigidbody.AddForce(camR * Input.GetAxis("Horizontal") * speed);
}
The player has a mass and drag of 1. Is there a better way to do this?