Hello
UPDATED: made an exact mirror version of
GetAxis for
GetAxisRaw, and the functionality below is now dubbed
GetAxisRawSwitch. That seems cleaner and better.
You feel that the movement of your character could be "snappier" or "tighter", especially for a platformer? Then you want to try out this action. What it does.The action is identical to GetAxis, but gets the GetAxisRaw value instead. This value is not smoothed out, and makes for "snappy" input. GetAxisRawSwitch has a checkbox to switch between GetAxis and GetAxisRaw, also at runtime. This also gives you the ability to try out the difference as you play, which is good for prototyping.
A little bit of explanationThe typical way,
Input.GetAxis gets the input from the player in a smooth way: assuming a controller with an analog stick, the axis value is smoothly cranked up to to 1 when you push right (-1 when left). Now, there is a twin called
Input.GetAxisRaw, which does not smooth out the input. It's either hard left (-1) or hard right (1), with gives a snappier and tighter control, which might be more suitable for your game. You can also use the raw to calculate your own smoothing (see Unity's documentation linked to above, or e.g.
Ease Float action).