How to detect quick thumbstick movement?

dumrique
Wed, 17 May 2017 20:29:28 +0000
Character & Animation

Hi, I want to implement walking and running similarly to the way it is done Super Smash Bros, where running is only triggered if and only if the thumbstick moves quickly to as far as it can go, and if the thumbstick moves slowly then the player will walk at a constant speed, even if the thumbstick is fully extended.

This is what I have so far that allows me to walk/run at constant speeds when the thumbstick axis is in certain ranges. But how can I detect if the thumbstick slowly moved and is still walking even if the the axis value has reached -1 or 1? And how can I account for running when the thumbstick quickly goes diagonally, at which neither axis reaches a length of 1, but the thumbstick is still fully extended?

Any help is very appreciated!

2 posts - 1 participant