NavModifier Component is not updating on destroy

Build Type:
Binary Build

Build version:
Version: 4.11.1-2934540+++UE4+Release-4.11

Detailed description of the issue:
If you create an Actor containing a NavModifer Component, even if you destroy the actor the effect of the NavModifier still persists.

Repro Steps:

  1. Create new ‘Top Down Project’.
  2. Go to ‘Project Settings->Navigation Mesh->Runtime’ and set ‘Runtime Generation’ to ‘Dynamic’.
  3. Create new blueprint ‘Obstacle’.
  4. Add a ‘NavModifier’ component to Obstacle and set the ‘Area Class’ to ‘NavArea_Obstacle’. (Optional: Add a Mesh for visibility)
  5. Place the Obstacle in the level and hit play. The Character will now avoid the marked area as intended.
  6. Now proceed to destroy the Obstacle Actor. (For example through a destroy on Overlap call with the visibility mesh.)
  7. Try to cross the same area again. The Character will still avoid the previously marked area, even though the Obstacle actor has been destroyed.

Happens 100% of the time by following the described steps.

UPDATE:

Okay, after crawling through a lot of engine code I found that manually calling UNavRelevantComponent::RefreshNavigationModifiers() from C++ on a second Obstacle (one that is not being destroyed) will lead to a proper update of the area for the destroyed Obstacle. So i guess for some reason there is a missing update statement for the dynamic generation of the navmesh.

Can you work around it by quitting the editor and restarting it?

Oh, that was a faster answer than expected. ^^
And no, restarting the editor has no effect. Also placing multiple Obstacles yields the same leftover effect for each Obstacle.

Well, dang. So much for a quick fix. We may need Epic Staff to create a JIRA issue for this one.

Hello,

I have attempted to reproduce your issue (thank you for providing repro steps), but in my project, when I removed the actor I was able to walk in the area that the obstacle was once placed in.

How are you destroying your actor, exactly?

My Obstacle Blueprint consists of a NavModifer Component and a StaticMesh Component (Cube). I set the Collision Preset of the Cube to OverlapAllDynamic and connected the blueprint node DestroyActor (with target self) to the Event ActorBeginOverlap of Obstacle.
Destroying the Actor with the DestroyActor node through an input event yields the same result.

The Character keeps avoiding the area, unless the destination lies within.

EDIT:

Also i just noticed that sometimes even while not ingame destroying actors by removing them with “del” will leave behind the obstacle area. This will then effect gameplay. Moving an actor, leading to a rebuild of the navmesh in the same tile, removes the marked area.

Hello,

After performing some additional testing, I was able to reproduce your issue in 4.11. However, after testing in our internal version, it appears that this issue has been fixed. This fix will be available in a later engine version. Thank you for your report and information.

Have a great day

I’m looking forward to that then. =)

Thanks for the fast solution.