What I am trying to do:
Create movable obstacle. Obstacle moves thrugh level freely. AI is allowed to move through obstacle but only as a last resort.
How I am trying to achieve it:
I am trying to use “dynamic obstacle” feature. My obstacle is a Actor Blueprint which I move through level. I want this actor to dynamically update nav mesh in its proximity so nav mesh trespasing will be more costly in obstacle proximity. However this doesn’t work. Repro steps:
-
Create blank Blueprint project
-
Prepare You level so You will have testing environment. You will need floor with nav mesh build upon it, light to see anything and that’s all.
-
Go Edit->Project Settings->NavigationMesh an under “Runtime” select “Runtime Navigation” to “Dynamic”
-
Create blueprint BP_Obstacle, inherit it from “Actor” class. In this blueprint add “Sphere Collision” component and make it root component. In sphere collision component select “Dynamic Obstacle” to true, “Area class” to “NavArea_Null” and “Can Ever Affect Navigation” to true. Also go ahead and uncheck “hidden in game” so you will see where this blueprint is on the level.
-
Place BP_Obstacle somewhere on the floor. Save all and run game. Open console and type Show Navigation. When navigation is shown you will notice that nav mesh gets properly cut where BP_Obstacle is on the level. Everything works as expected.
-
Now create new blueprint and inherit it from “NavArea”. Name it “NavAreaTest”.
-
Go to BP_Obstacle and change “Area class” to “NavAreaTest”. Save all and run game.
-
As You see navmesh doesn’t change around BP_Obstacle. Proper bahaviour would be for it to change color to magenta wich would mean that area around BP_Obstacle is our “navAreaTest”. Error
Cheers,
Dawid