How to dash towards the mouse?

Hello Great Flowlab Warriors! I need your help. How can I make the character dash when on clcik towards the mouse?

3 Likes

Get the Mouse X and Y (There is a behavior for this in the Triggers area), then bring the character X and Y closer to the mouse X and Y.

So if the character is at 5,5 (X,Y) and the mouse is at -5,15. Increase the character Y by 10, then decrease the character X by 10. Lower/Increase using the ease behavior to make it move that distance over a time, so it works like a dash. (You can also you things with velocity to make it a dash but that takes more calculations)

There are a couple of different ways to approach this, and it depends on the type of game you’re making. Is this a top down game, or side view? Do you want the player to dash towards the mouse, or to the mouse?

2 Likes

Sorry for the late reply Great Grazer. This is a top-down. Sorry if I didn’t mention this before.

1 Like

Does the character rotate to face the mouse?

Yes he does, he looks at your mouse

Then you can just increase the forward velocity if he is facing towards the mouse

2 Likes

And how do I do that sir Alpaca?

The Velocity behavior has a Forward input

1 Like

I see.
So sir you are saying on click, point player to mouse then make it move forward towards it?

1 Like

Yes, because you said the character already faces the mouse, you can then just move the character forwards

2 Likes