- Home /
Unity built-in axes - how do they work?
I'm a beginner in Unity, and when I try to make a moving character, i waste some hours to make it the "normal way"(for me)... But when i watch tutorials in YouTube, everyone uses that axes and they just need one "if" and 3 lines of code to make a cube move, but I don't get the point of that. Can someone explain how they work?
Answer by Dibbie · Oct 11, 2016 at 03:06 AM
GetAxis uses the player settings built into Unity for movement, so "Vertical" for example, registers whatever keys are bind in player settings for vertical movement - so forward and backward (by default is up/down arrow, and W/S keys) - you could do it manually yourself, you could use GetAxis (you can even change how these axis work in player settings), its really up to you, some prefer doing it the more efficient way, I personally like setting up my own "key binds" that acts like player settings, so I have easier control and manipulation in-game for the player.
The InputManager (Edit > Project Settings > Input, once there, click "Axis" from the Inspector to see the list) is where you can manipulate the "player settings" I keep referring to.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Replacing the Input Manager Asset with your own 2 Answers
Distribute terrain in zones 3 Answers
How to read the input manager from a script 1 Answer
How to edit an InputManager Axis' values through scripting? 1 Answer