Ease Rotate RigidBody2D toward arbitrary angle
- by Plastic Sturgeon
I'm trying to make a rigidbody2D circle return to an orientation after a collision. But there is a weird behavior I do not expect - it always orients to the same direction.
This is what I call in FixedUpdate():
rotationdifference = -halfPI + rigidbody2D.rotation;
rigidbody2D.AddTorque (rotationdifference * ease);
I would expect this would rotate 90 degrees (1/2 Pi Radians) off of the neutral axis. But it does not. In fact it performs exactly the same as:
rotationdifference = rigidbody2D.rotation;
rigidbody2D.AddTorque (rotationdifference * ease);
What is going on? How would I be able to set an angle I want it to ease towards, and then have it ease towards it when its not colliding with some other force?