2D Character Movement

So I’m working on a dash for my character right now. I can get them to dash forward using get forward vector and launch character but I can’t get down making them dash the opposite way. Is there a way to tell which way your character is facing and dash in that direction?

Hey there @YoungMarkyMark! Welcome to the community! So this is going to be dependent on if you game is top down, isometric, side scrolls etc. If your movement system is coupled with your facing, you can just change a facing variable whenever you move to reflect which direction you’re currently facing. Though that can be rigid depending on how many facing directions you have, often it’s better to dash only in the direction your player’s current movement is towards, which you can get through your input events.

1 Like

Hey @YoungMarkyMark! Welcome to the forums!

Can you explain in more detail the effect you are trying to achieve? Like a dodge backwards dash or something similar? Could you share screenshots of of the blueprints you have so far?

Any additional specifics or info you can provide may go a long way in solving your problem!

It’s a side scroller, I was thinking of doing something like when A is pressed (making the character face left) then press L shift to dash negative amount on the X Axis then vice versa for D but I just can’t seem to get the code to work.

It’s more of a dash in the direction the character is facing. I can get one direction down it’s just being able to switch depending on which way the character is facing is the problem I’m having.

Hey @YoungMarkyMark,

Check out this thread that had a similar problem. You may be able to store the last known direction as well:

I hope the above is the solution you need!

Thank you! I redid my movement system to follow these conditions and it helped.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.