I recently found some script which suits the game I am trying to develop, I require it for vehicle movement, this script being.
Vector3 localAngularVelocity = transform.InverseTransformDirection(rigidbody.angularVelocity);
It is supposed to get the local angular velocity of a rigidbody, however when I try to change a value of the rigidbodies local, it simply doesn’t work, I’m trying as so:
rigidbody.transform.InverseTransformDirection(rigidbody.angularVelocity).y += floatvalue;
Any suggestions as to how this piece of script would work?
Note: that code using it is to rotate the car around it Y axis so it can turn at varied X and Z angles.
Many thanks in advance, Ben.