Disable key if causes collision

G

Gary Matthews

Guest
Hi, how do i make it so that if the player presses a key that will cause a collision that it dis regards the keypress and continues moving in last direction
 
D

Dudeidu

Guest
Instead of using "raw" input (keyboard_check commands) set a variable that represents your last "good" input ,
so for example - when the player presses the left key and there is no collision, update the variable, otherwise don't (same with all other directions ofc).
Now check the direction to move at using the same variable.
 
Top