How do i limit top down movement to only go forward? - SOLVED

I’m using top-down movement extension to control my player character for a top-down 3d game (sort of like 2.5d). Is there a way to prevent them from backtracking? So that they can move forward or up & down (up arrow, left arrow, right arrow keys) but not backwards with the down key.

I’ve tried to put an object into the game to block them from going back by moving it a set distance behind them when they walk but it keeps shoving the player forwards infinitely.

If its not possible and i have to code my own movement, is there a way to also DIY the mobile joystick controls?

Hi and welcome!

First uncheck the “Default controls” in the top-down behavior. Then manually add the controls using the action “Simulate control”. Just don’t add control for the Down movement.

As for the mobile controls, check this tutorial out: Useful Mobile Game Controls To Learn - GDevelop

hi, thanks for the reply!

Unchecking default controls and manually adding them in events worked for keyboard controls, but i cant seem to get it for the mobile joystick.
I’ve watched the video and added the multi-touch mapper, but cant figure out how to stop them from walking backwards

in short, the current condition is that they can no longer move back using the arrow keys (good) but can still move backwards using the mobile joystick (not so good)

is there a way to stop them from doing that?

Can you show me your current events for the mobile controls to see what you got so far.

here! the cut off part is just the player object

Did you add the “TopDownMultitouchMapper” behavior to the player?
If yes, then remove it since you are mapping the controls manually.

Other than this, the player should not be able to move down without adding simulate control down in the events.

Removed the multitouch mapper and it works! thanks for all the help! :+1:

1 Like