Can someone help me with this issue/bug? So I have a stamina system and an adrenaline system that doesn’t drain my stamina when using it (where basically the adrenaline system is in the sense of a speed boost that doesn’t regen adrenaline). When I use up all of my adrenaline I am just normally sprinting which then lowers my stamina bar as it should but if I spam the adrenaline input key (which doesn’t do anything since it ran out) it affects my stamina bar by basically doubling the amount of drain on the stamina then what its normal rate would be. Does anyone have an idea on how I can prevent this?
Hey there @Twowheatbuns! Welcome to the community! It sounds like your input for your adrenalin is still doing something even if adrenalin is empty, should be a quick fix to put a branch at the front of the adrenalin input and check if it’s empty, if so just don’t run the rest of the inputs. Now this also indicates that you might have a bit of a cross interaction going with your stamina logic. If that doesn’t work out, or if you need me to point out where the issue is on your BP directly, you can post images of the BPs here and I can point out your next move!
I can post images soon I’m currently not by my pc atm but what you stated still wouldn’t fix it because the stamina or adrenaline doesn’t have to be drained fully for it to double the regen/drain speed. To clarify further let me just explain the stamina and forget about the adrenaline right now. If I drain my stamina at all it doesn’t matter if it is at 90 or 0 etc and I then crouch or am in idle and spam the shift key which doesn’t initiate sprinting because you can only sprint moving at a forward velocity, it doubles the rate or the value I’m not sure which one it is could be both but for some reason when you just spam it, it will just increase the regen speed. And it is only spamming it if I held it in it does nothing.
No worries we’ll be here when you can post them. Sounds like a BP logic issue for sure. Once you get some time and can show off the BPs it’ll likely become apparent! The fact the sprint resource can be effected without sprinting actually occurring helps make that call.
hi,
i had a same issue with my character and i found out it was due enhanced input, i used triggered not started. when i switched to started all was fine. hope that help´s, i am new here too
cheers
sorry for the long wait here is a link to the blueprint for my sprint/stamina system
Bp posted by anonymous | blueprintUE | PasteBin For Unreal Engine
I have not used any of the enhanced input system yet.
It looks like it might be your retriggerable delay is still firing regardless of if your stamina runs out. It’s still being fired by your previous logic even after the stamina used logic isn’t firing.
Also having a timer based on an output from another timer is bound to cause issues. It’s not a true delay so it’s not bad, but it can cause some issues down the line.
It’s usually best to have one line of inputs for events like this and have a sort of pipeline for them to run with encapsulated logic so you can’t get events being triggered from other locations.
To confirm it’s this retriggering, you can put either a breakpoint and step through, or a print before this retriggerable.
What would be the proper way to set this up without changing the entire bp. Do you have an example because I fixed the double regen but now when I spam the key instead of it doubling the bar just freezes until I stop spamming the key then works normally.
Hey there I have 2 different ways, one the way I handle mine (timeline) and another way without timelines.