Ok, so, I have a problem I think should be simple but it is apparently not. I’m building a tower defense game and I want to build a behavior tree and navmesh combination that allows me to build towers dynamically and have the enemies attack those towers if there’s no path to the target object.
I have tried a behavior tree that looks like the attached image, with a couple custom nodes that find the nearest tower and activate a gameplay ability (ATTACK in this case)
The problem is that it doesn’t seem to get as far as understanding the path doesn’t exist. I put dynamic nav modifiers on my towers and the nav mesh is set up to be Dynamic Modifiers Only. When I look at the navigation using ‘ShowFlag.Navigation = 1’ it shows my defended object encircled by towers, and red unnavigable territory around them, but the enemies keep trying to walk to it instead of going to the next step in the sequence.
So, I guess my question is how I get the enemies to recheck for the validity of a ‘moveto’ regularly and when it’s invalid to move along in the sequence. I’ve tried watching quite a few tutorials about pathfinding, but none of them seem to cover dynamic pathfinding all that well.