I can get my xbox controller to work with the analog stick by using Input.GetAxisRaw(“Horizontal”) or Input.GetAxisRaw(“Vertical”), however, I want to be able to determine the distance from the resting position of the analog stick and the current position of the analog stick - no matter which direction it is swayed in.
I want my player character to move in varying speeds depending on how far the analog stick is swayed, so the only way I know to determine that is by figuring out how far the analog stick is pushed from its center (or resting position).
Are their any techniques, mathematical algorithms, or alternative approaches someone could suggest? Thanks so much!
Just tried it out. It works as you said, so I very much appreciate the assistance. I do, however, have one question. The analog stick produces a magnitude of 1 or slightly more when I push my analog stick in the downward/right direction, but only a magnitude of approximately 0.92 if I push it in the upward/left direction. Any ideas on what might contribute to this? Thanks!