AI doesn't move because navmesh is regenerated constantly around player?

Hey, apologies in advance as the question as more of a “heck, maybe this is why as I’ve already exhausted all the other options?”.

Anyway, I’ve been trying to fix this for the past three days and even the good old Ballmer Peak doesn’t seem to do the trick. Bit of background:

  1. I have a simple procedural city made of identical buildings (might as well be 8m^3 boxes), where the end result if just a bunch of simple blocks of N’M buildings. This is driven by C++ inside a dummy object I place in the world.
  2. In my level I also have a NavMeshBoundsVolume that I’ve stretched to encompass the resulting level (haven’t yet looked into how to stretch it dynamically). It has dynamic generation set, even though it wouldn’t be necessary since I only generate the level once and it doesn’t see any further changes.
  3. I then made a simple AI character based on the UE docs “Behavior Tree Quick Start Guide” and placed one guy in my level.

Now the problem is that the AI just stays put. I’ve re-done the AI part a couple of times, I’ve triple checked the blueprints on all occasions and looking at the thing in the BT window while running reveals that the AI does track the player correctly (and even turns to face him!) but when it comes to actually moving, the enemy just prefers chilling.

I’ve tried setting various things on & off in navmesh generation as well as in the AI but nothing helps. Now I just noticed that the navmesh always shows up as red around the player. If I move the enemy to another part of the level, everything is green there. As soon as the player gets there, it’s all red again, with some tiles blinking between red & green every so often.

TBH I have no idea anymore if the navmesh or something else causing this, but I do know I’ve tried a LOT of things and nothing helps. So maybe someone can immediately point out what to try / what I might have done wrong.

Try testing if the AI can move at all by removing the controller you setup and set it to use the default engine AIController and in the AI event graph on begin play setup a simple move to location using AI Move To node like this:

Check if you have the NavMesh set to rebuild on load as well since you are using a dynamic generation. If he moves then there is something in your BT/tasks that isn’t working if he doesn’t move then there is something going on with your nav mesh. To test the BT/tasks etc make a new level and use the default minimum, scale up the floor to 5 in the X & Y and then place a navmeshbounds in the level and set it to 5000x5000x1000 and then set it to static generation. If your AI now moves then your settings for dynamic generation need to be looked at. You can also double check that the AI can move using the begin play move to here as well.

Thanks man, I’ll give it a go.

Well I’ll be, the simple mover you pasted works. So it must be something in the one I copied from the tutorial after all. Guess I’ll redo it the fourth time and quadruple check everything :slight_smile:


Just for future reference, I am an [REDACTED]. I had “simulate physics” on for the character… Works surprisingly well after I unticked that one.