Event Execute AI doesn't fire and blackboard key not being set. (More info in description)

I’m not sure what I’m doing wrong here but the Event Execute AI does not fire at all even when the task is being called. I have tried applying the code to the Event Execute and it works however the blackboard key does not set so the Move To node always fails. I am unsure if these issues are unrelated and are two separate issues but it would help a lot if someone can help me with this, Thank You!




1 Like

Hey @Verothis!

Click on your key and check the name, then check the one on the blackboard. This is always the absolute first thing to check when working on BBKeys. It has to be EXACTLY the same- no space differences, including at the end of the name, same capitalization, everything exact.

I see you have a few checks to test things, can you share your results of your printstrings with us so we know what your tests are saying?

Check that and get back to us and we’ll dive a little deeper! :slight_smile:

1 Like

When I try testing with Event Execute AI nothing actually happens but when I connect it to Event Execute it shows what’s shown in the photo, I can tell that the Move To node keeps failing so it keeps trying to find a new location I’m just unsure why. The other photo is what I have in the details panel for the key variable, it’s set to instance editable so I can select the key from a dropdown. I’m on engine version 5.1.


Try this:

image

Let’s see if it’s the random vector generation. Obviously, if this works, you’ll see more than 0,0,0 for the print.

Now, are you aware that you can leave the Behavior tree open and click here to watch everything in action? I find that most people don’t realize this is doable here- you can even edit some things in real-time, just be aware any changes you make during runtime will revert upon stop.

image

When you do this it will show the active value of all of you BB keys on the BT, which is a great help for debugging.

I did do what you suggested before posting, sorry for not including in the replies back, it prints out similarly to the other pictures but with values other than 0,0,0. I was also able to watch the Set Blackboard Value as Vector and saw that it was inputting other values into the Set node.

Okay, I added the BlackBoard component to the main enemy actor blueprint and now I can see that the Vector Key is changing within the Behavior Tree. Now it’s just auto firing the Move To node continuously. I also made the enemy actor as a character I’m not sure if that would affect anything but just trying to give all the info I can think of that could help.

All right! That narrows things down CONSIDERABLY!

Do you have a navmesh volume in your level? If not, add one, and press “p” with the viewport focused to see the movable area for your AI. If so, do that and show us what the Navmesh looks like!

Because at this point everything is working in your Behaviour Tree so we need to check on the things they rely on outside the BB/BT! :slight_smile:

Yeah I’ve even tried editing the Nav Mesh so that it refreshes and even placing a new one. I also got a photo of the Enemy blueprint so you can see the pawn values.


Well only one more thing I can really think of… Check the acceptance radius on the moveto node. I assume you’ll want that to be about 50, if it’s too wide, it’s not failing, it’s succeeding. Also try making your radius larger, more like 2000. If that stuff doesn’t work, try deleting and re-adding the moveto node.

I’m just unsure why the Event Execute AI doesn’t work either, the tutorial I was following used it but the event just doesn’t fire when I try using it. Also tried using a debug sphere to visualize where the outputs are going, shown in the photo. This issue also persists if I try making a new project.

Okay not sure if this is a fix for everyone but here’s how I got it to work, first delete the move to node if you are using it in the behavior tree for some reason it doesn’t work. Next your gonna want to create a new MoveTo task using the AIMoveTo node in the event graph (seen in the first picture). If the issue still persists then go to RecastNavMesh-Default in the world outliner and make sure Can be Main Nav Data is checked, if it is checked uncheck and recheck it again and delete the nav mesh and place it down again. I’m honestly not sure why this fixed the issue and I am confident that this shouldn’t work like this since Event Execute AI and the MoveTo node in the Behavior Tree still doesn’t work, if anyone has any insight as to why this is occurring please let me know.