Hello, I’m trying to make it so that my stamina depletion blueprint will stop executing when not using inputs. As the movement is bound to axis input and not an action, I was thinking of setting a condition for when the movement input is pressed but I can’t figure out when to change the condition to the opposite. What do you think?
To stop the stamina depletion blueprint from executing when not using inputs, you can add a condition to check for movement axis input. For example, you can use a “Not Equal To” condition with a value of zero for the X and Y axis movement inputs to check if any movement is being made. If movement is detected, the stamina depletion blueprint will execute, and if not, it will stop. You can then use a “Set Boolean” node to track the state of movement input and trigger the stamina depletion blueprint based on that.
Yes i already did this but unfortunately it doesn’t work still. Rn i found 2 problems in my blueprint: the first is that pressing sprint first and then movement will not initiate sprint and thus won’t deplete stamina; the second is that sprinting and then letting go of movement while still holding sprint will continue to deplete stamina. After some looking around i noticed that the conditions for which movement is pressed or not are checked only when the sprint input is pressed, since the action event starts only when Pressed or Released are verified. After some tinkering I quite dumbfoundedly understood that the input action for sprint needed to verify if sprint was pressed, not initiate sprint, and sprint itself is to be initiated in movement bp after checking if sprint was pressed and doing it with a do once node resetted by the sprint check bp. Thank you very much for your reply, it actually helped me view the proble from a different POV.
Best regards