Stop precedence with left and right

Found a way to avoid precedence of left upon right, and have the last direction key have the lead.
I applied the state concept and its implementation learned in terminal hacker (currentScreen if you remember :slight_smile: ) to the direction pressed by the user. 5 states and the transitions between them :

Input.GetKeyDown and Input.GetKeyUp are used
Regarding coding :
add a state variable out of the functions :
image

ProcessInput() looks like that :

With this extra function :
image

Privacy & Terms