NavMesh Doesn't Update w/ Prop Movement

Summary

With Navigation debugging on in my IslandSettings, I’ve noticed my NavMesh seems static to the point when the island loads. When I move or hide props (in any way, including prop mover, verse TeleportTo, MoveTo, Hide, etc) the NavMesh remains at the initial point where the props loads.

I’ve also tried modifying nearly every setting on my props (affect navigation, collision settings, etc) to see if somehow that’s impacting the NavMesh. The only thing that seemed to have some kind of impact is that using “Can Be Damaged” setting. When enabled on a prop and instantly moving it via verse at game start, the NavMesh does not appear to reflect the prop being in the original spot (as intended). However, if I move the prop back to the original location via verse, then NPC AI can not properly navigate around the prop since the NavMesh isn’t updated to reflect the prop moving back.

You can see here some props I set in the editor, but immediately hide using verse still affect navigation even though they aren’t there (happens with both hiding the prop and/or moving them).

I’m wondering if this is intended though? I’ve done a lot of digging over the last couple days and saw in UE5 there’s actually a global project setting to set “Dynamic” NavMesh generation. I can’t find this anywhere in UEFN.

Please select what you are reporting on:

Unreal Editor for Fortnite

What Type of Bug are you experiencing?

AI

Steps to Reproduce

  1. Place any prop in your map
  2. Make a verse script that moves it when the island loads
  3. Enable “Navigation” debugging in Island Settings
  4. Launch island

Expected Result

The NavMesh will represent the new location of your prop so that AI can properly path find around it

Observed Result

The initial position of the prop is reflected in the NavMesh, and AI continues to navigate as if the prop was there

If a prop was moved to a “green” area of the NavMesh, the NavMesh will not update and AI will have difficulty path finding around the prop.

Platform(s)

PC

I found a workaround that I’m not satisfied with. Apparently if you make a sequence then move the prop with a Cinematic Sequence Device, it will update the NavMesh. While it works, there is a little lag because it needs the sequence to complete first.

That also happens with MoveTo() method used via verse :frowning: Nav Mesh is not refreshing properly.

I’ve found another workaround that may suit your needs. Nav grid generation is messed up for Creative Props but it works for Static Meshes. You can attach Static Mesh that will serve a role of custom navigation collision to your Creative Prop. This way Prop will drive movement and Mesh will drive Nav mesh gen. Just remember to:

  • set Static Mesh Component within Static Mesh to “Movable”
  • set Static Mesh property “Can Ever Affect Navigation” to TRUE
  • set Static Mesh as “Hidden in Game”
2 Likes

Wow, that’s a great find, thank you for the help!

I tested it out by moving the prop in verse using an animation controller. I coded this up real quick just to move them up and down:

MoveProp<private>(InProp : creative_prop, InVerticalDistance : float) : void=
        OriginalTransform := InProp.GetTransform()

        NewZ := OriginalTransform.Translation.Z + InVerticalDistance

        KeyFrame : keyframe_delta = keyframe_delta
        {
            DeltaLocation := vector3:
                X := 0.0
                Y := 0.0
                Z := InVerticalDistance
            DeltaRotation := MakeRotationFromYawPitchRollDegrees(0.0, 0.0, 0.0)
            Time := 4.0
            Interpolation := EaseOut
        }

        if (PropController := InProp.GetAnimationController[]):
            PropKeyFrames : []keyframe_delta = array{KeyFrame}
            PropController.SetAnimation(PropKeyFrames, ?Mode:=animation_mode.OneShot)
            PropController.Play()

At first I tried your suggested settings directly on the StaticMeshComponent of the prop directly but it didn’t work. However, it did work with your proposal of nesting a new static mesh under the prop.

That’s much easier than having to make a bunch of sequences and CinematicSequenceDevices

I have the unfortunate case where, i’m spawning the props via verse ( SpawnProp() ), and unable to find a workaround that works.

Previously i’d been using a custom object pool to avoid using SpawnProp ( i’d read there were performance problems when using SpawnProp ). So i guess i could try using the pool again, and just having a custom hidden object nested below to ensure the nav mesh updates.

Please fix this one Epic!

Yeah, based on everything I found, I don’t think you’ll be able to dynamically create the prop in verse and have the NavMesh update. Unfortunately your object pool idea is probably the only thing that will work. :smiling_face_with_tear:

It does indeed work using the object pool approach with nested static mesh(s).

Not really ideal though, unless you know how many objects you’re going to need in an object pool.

1 Like

Just to add to this… Fixes for this seem to work inconsistently. Even when using an AI Navigation Modification device as a child of the creative prop, it doesn’t always update navmesh when moved via verse. Some game sessions it does, some not.

FORT-836881 changed to ‘Needs More Info’. We’re missing information that would help us determine the source of the issue.

I’ve been playing around a lot more with the npc spawner and messing with nav mesh. Let me know what other information I can provide to help. As @MidnightCow mentioned, there’s a lot of inconsistency in how navigation is working for npc’s.

1 Like