|Topic was automatically imported from the old Question2Answer platform.
I’m making a platformer and I need to make it so that when the player enters an area , they cannot use the arorow keys to move. (Basically , disable the arrow keys)
I would appreciate it if anyone could help.
the easiest thing would be to add something like this to the top of your movement part (before
and then e.g. your
move_and_slide won’t be called when
is_in_your_area is true effectively disabling the movement of the player (you still need to set the value of
is_in_your_area or any other variable you use depending on if the player is in the area or not, there are signals for that)
also, if you share your movement code, we can more precisely say what to put where