Using looping timers to repeat Actions

Now, we want to customize our sprint Blueprint nodes to fire the custom Event that we just created so that the player's stamina drains as they sprint, as seen in the following screenshot:

From the output execution pin of the node setting walk speed to 2200.0, drag a wire onto empty space and add a SET Is Sprinting node. Check the checkbox inside this node to set the Boolean value to True when the player is sprinting. Next, we want to make sure that stamina is continually drained as long as the left Shift key is held down. To do so, we can utilize a timer, as shown in the following screenshot:

Timers ...

Get Blueprints Visual Scripting for Unreal Engine - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.