Hi there, I am currently trying to achieve a rotation to a 3D object on only on axis, this being the Z axis.
Imagine this scenario, the player is shot out of a cannon, with a random speed based on some previous actions, I then need to player to rotate, based on the speed of which it is throw out the cannon, any help is much appreciated!
Thanks
(C# is prefeered, but UnityScript is also good )
I think you are asking this:
float rotateSpeed = rigidbody.velocity.magnitude * factor;
transform.Rotate(0,0,rotateSpeed * Time.deltaTime);
โfactorโ is a variable you define that maps a velocity to degrees per second.