Ai behavior tree task, target location is invalid

Hey all. I’ve began work on my ai cause I wanna start making ti so my buildings will build from the ai but I’m running into an issue where my target location is appearing invalid.

Basically I spawn the ai with a button then place a building that needs constructed, they run to the entrance and begin construction. The target location keeps showing up invalid and the behavior tree won’t even execute the command.

For some reason setting up is valid nodes also seems to do nothing. I’m really at a loss here cause I don’t understand why it’s not working, additionally the building can’t be blocking the navmesh/entrance as the “entrance” is the sphere in the middle of the collision box.

Any help appreciated

Here’s my code

Check your blackboard and make sure you spelled “Target Location” EXACTLY as it is spelled in the blackboard, otherwise it will think its a different variable. Even if there is one “space” extra in the variables it won’t recognize it.

Chances are the building is blocking the navmesh, hence your ai can’t nav to it. causing it to fail.

Also where do you set the proxies array? If that doesn’t have at least 1 element your branch node will always execute the “false” and your behavior tree will never “finish” execute, which is required for a sequence node to move to the next task. So if it can never “finish” execute because the array is empty, no value is ever set for the target location and the BT stalls on that one task.

I don’t think that’s the problem though cause the entrance is actually outside of the mesh’s bounds by “50”. Only thing that could be blocking would be the collision box but it’s set to ignore everything.

Well looking at my code the construction proxie has nothing to pull from an array which is weird cause I’m following a tutorial series and his is setup the exact same and works fine. Hmm.

Dunno what to tell you man, but that would be the issue with your BT, something is wrong with the setting of those arrays. Need screen shots of how those get created.

press P to see the navmesh. just make sure.

■■■■ I think your right my bad, any idea how to fix this? Sorry if I’m being dumb total noob over here.

I think your right! The sphere is where they need to go to. I’m a total noob tho so sorry if this is stupid but how would I go about fixing this?

If you open your house mesh and check collision to see where the boundaries are is the collision a foot or two away from the house like the area blocked out of the nav mesh? If so you need to redo the collision in the modeling software to more closely match the house, move the sphere further from the house or check the option on the mesh for “use complex as simple” collision (more expensive as collision is detected per poly)

No the collisions are correct, hmm. I just think the tutorial I watched is incorrect now. I’ll have to figure something else out then, thanks anyways man.