- Edited
I am doing a top down game with 8 diagonal movement and both animations and the movimentation itself is working, but I can't figure for the life of me how can I make the player not stop when two keys are pressed at the same time, like left + right and up+down. it may be because the formula I am using is
inputVector.x = Input.get_action_strength("ui_right") - Input.get_action_strength("ui_left")
?
inputVector.y = Input.get_action_strength("ui_down") - Input.get_action_strength("ui_up")
Because instead of doing checks with "if input.is_action_pressed(...)", I am using if inputVector.x >0... So I get that if inputVector.x = 0, the player is not moving. If right (1) and left (-1) are pressed at the same time the result is zero (1-1).
So that is why I wish I could possibly make the player ignore the second input for the up+down and left+right combination and the third input for diagonals (up+left+ right or down, etc...). Or Maybe make a transition from left to right, up and down and ignore it for diagonals and so on (which I think it is better, since I believe controls will feel more smooth?)
I have searched for help from other diagonal controls tutorials on youtube and around, got no result that covered those specific problems. Tried for hours to get a solution on my own for this problem but I still can't figure how.