Download

I'd like to do different actions based on the speed the gamepad axis was tilted

http://i.imgur.com/n6AvyxW.pngn6AvyxW.png

Is there a simple way of adding speed of tilt in this sort of function? the end result would be 8 launches 4 are slow tilts 4 are fast tilts

Currently- the major direction of tilt is measured and if the bottom button is pressed a jump is executed in that direction

I’d like it to execute a different jump if I really slam my joystick in a direction quickly + button

I would start by deciding on an action that would indicate the start of the tilt. So if e.g. the player is expected to press the bottom button then direction, I would store the time of the bottom button press. I would then have a time, after which I consider the launch expired so e.g. 500 milliseconds. I would then keep checking the joystick input (you’ll probably be checking for a certain value so e.g. 70% or more is considered valid) and wait for my time to expire, whichever comes first. If input comes first, check how long it took and if you consider that time short, do the fast launch. If the time expires or the the time-to-input was long, do the slow launch.