Should I store inputs in a script ?

Hello,

I’m actually following the Stealth tutorial (just finished 2.4). I see that, to avoid typos if I understand well, we stored every tag in a tags class. But every time we refer to an input, like “Horizontal”, “Sneak”, “Attract”, we have to type the string, and to be extra careful not to make typos.

Is it a good idea to create something like this :

`public class Inputs : MonoBehaviour {

public const string horizontal = "Horizontal" ;
public const string vertical = "Vertical" ;
public const string sneak = "Sneak" ;
(...)

}`

Are there any cons ?

You can still make typo’s with the variables, like typing verticl instead of vertical. Making a typo in either the string or the variable would both throw an error that’s easily traceable.

But no, doing this won’t really burden you at all.