So im tying to have a slow mode feature in my game thats binded to a bar. so when the bar is empty you cannot use slow mode. The code below works but i have 2 problems.
Global Time Dialation effects the bar. So it drains slower when in this mode. Is there anyway to fix this?
The bar continues to drain after i exit the mode.
Any help would be appreciated. Also maybe this isn’t the best way to code this. If there is a better way let me know . please and thank you
So the first thing I see is that you are continuing your time dilation so long as you have not reached your max, but you are subtracting from your total. Shouldn’t you be looking for your minimum? Also, what is your “Is Reflex Down” boolean? If you are holding the button down or something else?
Additionally, since you are using global time dilation, have you tried using a custom time dilation node for your actor that needs to run at the correct speed? Check out this non-Epic tutorial on custom time dilation:
The Custom Time Dilation Node works well inside my HUD BP. Thank you
The Is reflex down is my attempt to only run the code when the key is pressed down. Doesnt work so i removed it. Still confused on how to run the code only when the key is pressed down. I thought the new input system would do this for me.
I Figured it out. I put the code inside a function instead. And added the custom time dilation to my player HUD so the bars are not affected by the dilation