Why is my AI failing this simple code?


1 Like

Hey @ADHDeveloper!

Try getting your actor from RANDOM and using “Get Actor Location” and plug that into the Location input on the AI MoveTo and see if that helps!

Let us know if it does what you need, or if you need additional help! :slight_smile:

2 Likes

this keeps failing in run time as well

1 Like

The only guaranteed work is setting the move to the players location.

1 Like

Can you show us what you’re trying with a screenshot? This should work with the location and actor.

There are also other MoveTo options! For instance, setting the chosen actor on the BlackBoard using this task, then using a moveTo node on the Behavior Tree!

1 Like


I have diagnosed the generator actor itself for some reason never works when telling the AI to move toward it in any way but other actors work. I am unsure why

You may want to extend the Acceptance Radius on the AI MoveTo. Acceptance radius is drawn from the center of one to the other- and that’s .1 meters. Which means the acceptable radius is within the little squares, so it’s not on the navmesh. Try increasing the Acceptance radius to 100, then if that fixes it you can re-lower it. :slight_smile:

1 Like

The AI move to node fails because there is no path on the nav mesh leading to your generators. Looks like you are using NavArea_Null as the Area Class Override for the generators collision box and it is stopping the AiMoveTo node from finding a path. If you change the Area Class Override to NavAreaObstacle it should allow moveto to find a path and cause the AI to want to avoid walking over generators unless they had no other option.

1 Like

That sounded like the perfect fix but shockingly I tried it and the AI still fails

This does not work either unfortunately

@jay001020 is right, this would guarantee a failure.

Can you show your navmesh showing this? It should look uninterrupted, but underneath the generator it should show a different color.

looks like your generator is preventing the navmesh from generating. Ai can only walk on green area.
try to find “can affect navmesh” in both the generator mesh and the collision box details panels.and uncheck it.

1 Like

@baobao4435 is right. You just need to make sure the “Agent can step up on” is also unchecked, and the acceptance radius is large enough it’s not going to fail because it can’t reach the center point of the generator. :slight_smile:

1 Like

Did you get it figured out, @ADHDeveloper? Let us know for future answer seekers!