Set Boolean on Behavior tree

I’m trying to do a Stun effect but the boolean is not been set to true.


Hey @DeusaCremosinha!

Let’s try to gather some more information.

First, make sure your “Make Literal Name” and your Blackboard bool are both EXACTLY the same (check for spaces at the beginning and end!).

Next, make sure that bool value variable is being set first! Try disconnecting it and just checking the box to make it guarantee True- if it sets, we know the issue is with the bool value, not the blackboard passthrough.

Where is the Event “enemyFear” located?

Is the event being called? Try putting in a printstring both before and after the Validated Get on that event!

Check that stuff out and let us know what you find! :slight_smile:

Thank you for your help! everything seems to be ok with the Make Literal Name; Actually I tried with a varible just to test it, but it was originaly with true directly, no changes at all; The event is been called and it’s on the AiController, only the set is not working for some reason

Okay, great!

Can you show the behavior tree with that enemy selected in game? Also, I’d put a print string off of “Is Not Valid” on the validated get blackboard there- that could also be the issue.

Also, with the Behavior tree open and the AI selected through the dropdown at the top, you can pause the game and step backwards through the tree. Definitely keep the “Set Value as Bool” as just a checkmark instead of a variable, promote it once it’s working to have as few moving parts as possible before scaling. :slight_smile:

Here!

I don’t know how to step backwards through the tree tho, kinda new to this

I don’t know if this can be the issue but I’m not initializing the Fear too, just goes to false by default

You can’t step forward without stepping back first- but if you step back a bunch you can then forward step an equal amount to watch it slowly execute.

Notice how in this picture one of them is green? That means on this step, “BTT_JumpTowardsTarget” Succeeded and now it’s executing “Wait” since it was next in the sequence.

Either way- did you try the print strings? The behavior tree stepping was just one idea for debugging and just a little side-learning opportunity - the print strings are important as well, even more so. :slight_smile:

Go put those in and check if it’s getting to the set node! :slight_smile:

Yeah, everything seems fine with printing, it is printing on Valid and not printing on is not valid. Mine BT seems to have all the steps disabled for some reason.

After some time I fixed some stuff on the controller and found the one mob been set, but he is not going to Wait 5s even if Fear is true

Awesome! You’re close!

Now you need to go to the decorators there on the Fear is Set and Fear is Not Set.

There’s the “Abort” options that will stop things if the variable on that decorator changes- that’s how you can stop the move action if you inflict fear on the enemy, or stop the wait if the fear is removed.

For that, you’ll want to set it to “Observer Aborts SELF” for the left one, the one where fear is “True”. That way it will just abort that node and move on.

For the second, right hand one, “Observer Aborts BOTH” so it will reset the node and run it from the top again- the only way to get it to the left side.

Hope that helps!