Is there any way to disable an action mapping when my stamina bar is lower than a certain amount?
I am trying to figure out a way to disable the ability to sprint and jump when I have no stamina left. I have a stamina system set up which decreases when you sprint or jump, however you can still continue to sprint and jump with 0 stamina. This is why I ask the question, can I disable the ability to sprint and jump if i have 0 stamina.?
asked Sep 16 '14 at 10:23 PM in Blueprint Scripting
Why yes of course.
You have a few options but disabling the mapping is not one you should try to achieve.
I'm not quite sure how you set up the run function but I'm sure you have something that makes you stop running when you release the button.
Add a branch on the "on actionButton pressed" and check if you are on or below 0 stamina. If so do nothing.
Add a "EventTick" and do the same. If it should be below 0 stamina add an execution line to the part where you already stop the running.
Does this get you somewhere or should I add a picture of a potential function?
answered Sep 16 '14 at 11:45 PM
In addition to what Erasio said, you should always clamp your stamina between zero and its max value, then check if its zero for a cleaner process. Type "Branch" after right clicking; it should give you an idea.
answered Sep 17 '14 at 12:13 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here