I have a simple AI Character that moves from point to point and it will change its path if there are obstacles in way in order to make it to destination . This works fine problem is that when I change environment during gameplay , it will still follow same path meaning that it will not be able to reach destination . It seems that navigation is built when you before you open a level , but is there a way to change it during gameplay ?
Go to Edit > Project Settings > Navigation Mesh and make sure Rebuild at Runtime is enabled. When you hit Simulate, you should see your NavMesh update as your environment shifts. Let us know if that doesn’t fix issue for you!
I’m not sure that solution you suggested above fixed DaveHall17’s issue, but I know that it didn’t fix mine. I’ve placed walls to block a path and started game. wall is then removed mid game, but AI characters cannot move through open path. I’m assuming NavMesh isn’t recalculating.
In addition to Rebuild at Runtime setting, go to Edit > Project Settings > Navigation System and make sure Build Navigation at Runtime is enabled. Also check your Dirty Areas Update Freq; this should be at 60 by default.
Quick question about video; What is platform that is moving? Is it an Actor or components of an actor that has moved?
I ask because if a component is moved, but not entire actor, it will not update navmesh. Please let me know if that may be related to issue. Thank you for your patience as we investigate error.
Okay, I’m going to try and duplicate your project in 4.1.1 and see if I can reproduce issue. If I can, I’ll then try updating project to see if an updated editor would solve problem for you. My suspicion is that it will; there have been some improvements with Nav Mesh system since 4.1. Is there a reason you haven’t updated to 4.3 yet?
If you wouldn’t mind, could you let me know a few things before I start:
Are your walls Blueprints with a Static Mesh component? or are they BSP brushes or Static Mesh Actors placed in level?
What are you using to remove walls? Level Blueprint, Blueprints themselves, or something else?
I imported a simple .fbx model that is being used as a plane to walk around on. wall pieces of geometry, that are being moved off of plane, are also simple .fbx models. They each have their own Static Mesh component.
wall pieces are being moved with Level Blueprint with a simple button press, as is AI character.
character is sent from a Target Point A to Target Point B, and is unable to reach point whether wall exists or not. wall is initially positioned in place when game starts, and NavMesh doesn’t change when wall is moved in-game.
Okay, I can confirm that issue that appears in 4.1.1 is fixed in 4.3.1. If at all possible, I would recommend upgrading and then making a copy conversion of your project, making sure settings are same as listed above, and see if you run into same problem. There were a fair amount of improvements with Navigation and Behavior Tree systems with last few updates, and you might run into fewer problems.
I believe that class is no longer used as of 4.2. Did you create this project as a code project or add code to a Blueprint project? Or did you build it from source? Either way, it is possible you added that file at some point and it shouldn’t be necessary anymore. Most likely it is referenced in [YourGame].h as an #include.
If you can find it and get rid of it, then build and save project, you should be able to convert project through Launcher to 4.3. Let me know if that doesn’t work or if you can’t find file.