I am currently working on a space game (sideways look, scrolling top down). I am using Input.GetAxis(“Horizontal”), for input to controlling multiple behaviors for a space rocket. GetAxis seems smooths from zero to ‘some value’ when pressing a key, and from this value back to zero as it is released. One of the things I am using the result of GetAxis to, is handling an EulerRotation of the space ship.
It works decently most of the time, but I am not satisfied with the result of pressing one key for one direction, and then pressing the one for the opposite directions, as this resets the GetAxis value to zero at the occurance. The result of this is attempted illustrated in the added figure below.
Jumpy angle shift. This is an issue as I would like to have some very polished mechanics.
I am looking for a way to disable the result of pressing ‘d’ whilst the rocket is tilted counter clockwise (in context of the example). Either that, or some interpolation for the values, so that ‘smoothness’ is preserved. Any input on this, methods or direct solutions, are appreciated.
Thanks in advance.
P.S. I program in C#, but understand JS easily.