This tutorial will go over creating two basic functions to use in our input class that will use the thumbsticks. These two functions will be identical in concept to the triggers but will involve a little more work to get the same result. Thumbsticks are very important to most games so having an easy function will probably save a lot of trouble. Before I start I would like to first say that the thumbsticks use a normal Cartesian coordinate system where the center is the origin, that is you haven't moved the thumbstick at all. To the right is the positive X, left is negative X, up is positive Y and down is negative Y. This is slightly different from the screen coordinate system where down is positive Y and up is negative Y so that is just a heads up.
So we want to create two functions one that will return the value of a thumbstick ( left or right ) and another that will return a bool for if we passed the threshold in any direction ( left, right, up or down ). So were going to start by creating two enums one for the thumbstick and another for each direction. The thumbsticks enum is the same as the trigger enum so we could combine to one enum, but I doubt having two enums with the same values will make any performance issue and the clarity we get is really nice.