I’m trying to figure out how to setup auto sprint. What I mean is the following:
When I hold down Shift, I sprint. After lets say 1 second of holding, I let go and continue to sprint, until I press another input(ex aiming with mouse, fire weapon, or hit an object). So when I do any of those key presses or hitting a wall, my speed returns to normal.
Hi man
Depending on what are you using you should: setup the shift key imput , or enable imput on your actor.
When that is pressed you start a timer , you can read here how https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/UseTimers/Blueprints/index.html
Otherwise you can take care of the time yourself , picking up the time from the tick event and adding to a var until you reach 1 (sec). When your var reach 1sec you add to your speed (movement component, or variable or what you are using…) And set another bool variable "Sprinting " to ON.
There should be a event called keypress. that get fired everytime you press a key.
In this event check if your variable Sprinting in On, if it is Set your speed to the normal average value…
Or just decrese the speed until its normal.
You could do a sprint that happens and after a delay of one second, if shift is still down then shift stays on, then, when any key is pressed disable sprinting.