I looked at the API of GetAxis and it says:
The value will be in the range -1…1.
What does this mean?? Does it return a random value between -1 and 1? How does it choose what to return?
It would be great if someone explained this to me :)!
I looked at the API of GetAxis and it says:
The value will be in the range -1…1.
What does this mean?? Does it return a random value between -1 and 1? How does it choose what to return?
It would be great if someone explained this to me :)!
It’s “input” from the player. Like for the horizontal axis of a thumbstick on a gamepad, -1.0 would be all the way to the left, 0.0 would be the middle, and 1.0 would be all the way to the right.
What about for keyboard input when either it is pressed all the way or not? Does it go just straight to 1 or -1?
Yes. Keyboard input just skips the analog input and goes straight to -1, 0 and 1 in each axis.
There are two more values that smooth out keyboard input in your input manager. They make the transition on key press snappy or smooth depending on the values: Gravity and Sensitivity.
For more info hover your mouse over each value for the tooltip or read the manual. ![]()