Use code tags for your code.
They way you’re doing this is by elaborating states of a broken state machine (as evidenced by that case -135
). Don’t do that. Focus on simple tasks, and make sure they work as expected.
This is what you should do first and foremost:
Construct a Vector2 from your input controls such that it reflects the state of the input.
For example:
(1, 0) would be returned when you press right,
(1, 1) when you press up-right, and
(0, -1) when you press down.
This is one possibility for the old input system
Vector2 control = new Vector2(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"));
And here’s a simple tutorial for the new one.