Keep rotation after movement

FangFang Member Posts: 33
edited November -1 in Working with GS (Mac)
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

Comments

  • CaptFinnCaptFinn Member Posts: 1,828
    I would love to have that bug. I cant get things to stop spinning. example: a pool ball. once it stops rolling it doesnt stop spinning.
  • scribblstudiosscribblstudios Member Posts: 118
    I would try putting your vector to angle stuff inside of a rule that says, when self pos y ≠ mouse pos y and self pos ≠ self pos x, perform math.

    Hope this helps! :)
  • FangFang Member Posts: 33
    @Scribblstudios
    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!)
Sign In or Register to comment.