- Home /
How do you change the joystick axis boundary from a circle to a square?
When getting input from either the horizontal or vertical axis of the joystick (I'm using an Xbox 360 controller), I get a lower value when the stick is completely tilted towards the corners compared to the sides (about 0.7 and 1.0 respectively). This shows that the boundary for the axis is a circle.
However, this means that my character controller will move slower when moving diagonally compared to the sides. This issue would be resolved if I could change the boundary to a square so the corners would return 1.0.
Answer by toddisarockstar · Aug 12, 2017 at 10:12 PM
actually those floats axis values come from the controller.... not unity. and actually, if the controller allowed both axis to be 1 you would be moving faster.
if you move something a distance of one up and one over, the distance from your start is 1.41. If you move directly to the side by 1 the distance is 1. another words the diagnal movement every frame would be faster and that's why your controller is designed to limit the corners.
http://www.mathwarehouse.com/algebra/distance_formula/index.php