Character control via mouse/cursor

Hello, I’m nxT90.
I just started using this engine not too long ago and I have a desire to learn it. If anyone could help me with the problem explained below that would be great. :slight_smile:

I want to be able to control my character using my mouse, but as I said I have a problem.

When the mouse is moving up, I want the character to follow it, but I also want it to change the animation.
I also want it to change the animation when the mouse moves down and when the mouse is stationary.

The problem being I don’t know how to do it beyond having the character follow the mouse.

How do you actively track the mouse position and change something based off that value?

The current code I’m using to control the character using the mouse…

Condition: None Action: Do =MouseX();=MouseY() to the position of Character

You would need to save the mouse position (x/y) in a variable at the end of the event sheet and compare the current mousex/mousey values to the stored ones from the last iteration of the game loop.
In the next step you need to find out if the difference on the x axis is greater than the difference on the y axis and set your animation accordingly.