Hello all i have tried many options and i have no idea why it is not working
i have an object spinning in a circle motion
everything is fine entering good
spin in the way it should
but i want its rotation to be accurate to the movement of the rigidbody moving it
i have tried
if (rigidBody.velocity != Vector2.zero)
{
transform.rotation = Quaternion.Euler(0f, 0f, rigidBody.angularVelocity);
}
//or this one work ok but jitter
//i tried in update fixed update late update
if (rigidBody.velocity != Vector2.zero)
{
var moveVec = new Vector2(rigidBody.velocity.x, rigidBody.velocity.y);
transform.rotation = Quaternion.LookRotation(Vector3.forward, moveVec);
}
and many other variations
Please help !