Rotate a sprite AWAY from the mouse

Greetings,

I’m aware of how you can make a sprite rotate towards the mouse and all, but…

I have a rare case where I would like to do the opposite: Making the sprite rotate AWAY from the mouse.

I tried doing things like making MouseX and MouseY negative, multiplying them by -1, adding 180 to them, but nothing worked. I can’t find any posts about anybody wanting something to rotate opposite of the mouse either.

How do I do this? Thanks

Hey,

Use this action:

  • Set angle of object to: AngleBetweenPositions(CursorX(),CursorY(),object.CenterX(),object.CenterY())

Notice the angle is cursor → object (not object → cursor) so it’s flipped.

1 Like

Thank you, but what I tried here isn’t working:
image

If it helps, I would like to keep the angular speed so that the rotation isn’t instant

I’m not really sure why it’s not working. I tried it and it worked fine for me.

Can you give more context on what’s actually happening when you run this event? Also can you share a screensho, or even better a video recording of the problem?

Oh nevermind, I just didn’t add a boolean check correctly. It works now, thanks!

1 Like