Rotate rigidbody to specified rotation using AddForce
Good Morning!
I'm working on a controller that requires me to rotate a Rigidbody to a specified rotation using the physics engine. Essentially I need help with the "Do some calculations" portion of the below code snippet.
I've done quit a bit of searching and found some related information but I'm still struggling on putting it into useful information to apply to this problem.
Intuitively, I think I need the difference between the current rotation and my target rotation. Take that difference and multiply that by a speed variable and then apply that force each frame until I get to my target rotation. However, about half way through I would probably need to work on de-accelerating the rotation to stop at the desired rotation...or close enough.
capture.png
(36.2 kB)
Comment