Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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?

Product Version: Not Selected
more ▼

asked Jan 22 '15 at 11:46 AM in Blueprint Scripting

avatar image

2k 157 153 209

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

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.

more ▼

answered Jan 22 '15 at 01:20 PM

avatar image

6.8k 333 185 470

avatar image Slavq Jan 22 '15 at 01:31 PM

This Animation Notifier idea is good, i think it will do the job! :) Thanks!

btw. In my case "startRunning" animation is required to have unique startup for player, blending is not enough :) The same way i have "braking" animation that is played when player is close to his goal.

avatar image Askyl Oct 26 '17 at 09:52 AM

Was looking for the same thing! :) Notify start and end to change bool to stop movement / aim. Great and easy way to fix this!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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.

more ▼

answered Jan 22 '15 at 12:25 PM

avatar image

202 16 24 35

avatar image Slavq Jan 22 '15 at 01:17 PM

No, when i started, Behaviour Tree was so bugged that i've decided to do AI logic in class blueprint. Well, i'll check if i can remake it to use behaviour tree and if it will help.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question