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?
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.