Set boolean to true and back to false for Animation Blueprint
In my character AI i have a function "GoToLocation" and it's called every tick in player controller using Gate (to allow steering with pressed, not released mouse button) In this function i want to set boolean "playerStartedRunning" to true, because players' Animation Blueprint needs to read this and play "runningStart" animation when it's true. But it needs to be true only once, to play this animation once. I've thought about setting it true -> Delay 0.01s -> set to false. But Delay node is not availabe in functions :(
Previously, to "send a message" only once to anim blueprint, i've used Event Dispatchers and assign them in Animation Blueprint, but using Event Dispatchers with Animation Blueprint broke my whole project (good that i've made a backups) So i need to do it in different way.
Shortcut: Every time player starts to run, i want to set "startedRunning" to true and then immediately to false, because animation blueprint needs to play animation only once, at beginning of running. How to do it? Maybe is there some better solution?
asked Jan 22 '15 at 11:46 AM in Blueprint Scripting
Hm, you could use a Animation Notifier on your StartRunning animation that sets the bool to false.
Or you rethink this whole setup. You can simply make a blend space to blend between the start animation and the walk/run animation. Normaly you won't even have a "StartRunning" animation. You will just blend between idle/walk/run with a blendspace.
But if you really want to use it this way, then you can try using something like "DoOnce" function before you start your AnimationMontage and reset it as soon as the player stands still. So it can call the montage only once.
answered Jan 22 '15 at 01:20 PM
I don't know if it answer your question. but are you doin it using behaviour tree? If that the case maybe you can just set a blackboard variable with a task node before you play that move to location task . n read it in your code.
answered Jan 22 '15 at 12:25 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here