Keep rotation after movement
![Fang](http://forums.gamesalad.com/applications/dashboard/design/images/defaulticon.png)
Hey guys
I have an actor that follows the mouse, and rotates based on its movement so it's always heading forward (using de vector to angle math). However, when it reaches the mouse, it stops moving, thus causing it to revert to a rotation of 0.
I was wondering if I can get it to keep the rotation it last had when it's not moving. As in, I move it downwards, rotation is 90. It reaches the mouse, stops moving, rotation remains 90.
Any help would be much appriciated!
~ Fang
I have an actor that follows the mouse, and rotates based on its movement so it's always heading forward (using de vector to angle math). However, when it reaches the mouse, it stops moving, thus causing it to revert to a rotation of 0.
I was wondering if I can get it to keep the rotation it last had when it's not moving. As in, I move it downwards, rotation is 90. It reaches the mouse, stops moving, rotation remains 90.
Any help would be much appriciated!
~ Fang
Comments
Hope this helps!
Ah, why hadn't I thought of that. So simple! Thanks, works like a charm now.
@Jeffnichols
You might want to try something similar: if linear velocity/movement = 0, contrain rotation to current rotation
(not too sure if they would work, but you can always try!)