I am trying to program stamina where 5 stamina is taken away for each second of running. When stamina hits 0, the speed of the character is supposed to to go back to normal speed. When StopSprint() is called, the stamina should start regenerating at 2 stamina per second. I was able to code the sprinting aspect without the stamina limitation completely fine where the character will get faster while the r button is pressed. However, when I programmed the stamina in, it compiled fine but when I press the r button the engine instantly freezes. I assume this is due to an overload but I am not sure what I am doing wrong.
Attached are some pictures of my code. I am using some timer functions that are described here: https://docs.unrealengine.com/latest/INT/Programming/UnrealArchitecture/Timers/index.html
It is very likely that I am using these timer functions wrong since I do not completely understand how the iterations work. When I first tried it out I did not ahve the clear timer functions, so I added them after I figured that the program was creating infinite timers that would just cause the system to freeze, but the timer clears didn’t fix the problem.
Any help would be appreciated! I know that some of my comments might be a little off and its not very stylistic at the moment but I did not have much time to refine it and really want to fix this problem first.