My Zombies Are Getting Stuck in a Rock

I have an area with some creature spawners and a rock … and my zombies keep getting stuck in a rock. It’s almost like they are drawn to it like a magnet. They start outside of it, I can run around and then they try to walk through it, and most of the time they get stuck inside. Is this a known issue? Or is there something I can do to prevent it?

Here’s a video showing what it looks like:

Did you try to debug the navmesh ? They should be going around the rock, easiest way to fix is to add an AI Navigation Modification Device around the rock

2 Likes

How do I debug the navmesh?

Edit: Thanks man! I found this page. I’m going to check it out.

1 Like

So I turned on navmesh, and there is a red zone around the rock. On my dev machine, the AI won’t enter the red zone. (Vid shows how they navigate around it both with navmesh debugging on and off). They go around it like they are supposed to.

EDIT: For some reason, after turning navmesh debugging on, testing it, turning it back off, testing it again, then rebuilding and reuploading everything - it is all now working correct on all platforms in the playtest version. Zombies won’t enter the rock. And I didn’t do anything that I know of to fix it. Confused. :confused:

1 Like

Weird, the rock is always loaded ? I’d add a navigation modifier just to be sure :3

I figured out how to make the red zone around the rock disappear in the navmesh during a game. Trying to track down exactly what is causing it… will post again.

1 Like

Well, I tracked down the issue. If you do this:

PropTransform := PropObject.GetTransform()
if( PropObject.TeleportTo[PropTransform] ) {}

The prop will lose it’s red zone in the navmesh. And it never comes back. Which means the AI will just walk right into the prop and then either walk all the way through it or get trapped inside and not be able to get out.

Which is slightly alarming since I have about a zillion props that I teleport around on my map. I was not aware this was an issue until now.

For some reason, MoveTo doesn’t exhibit the same behavior. Just TeleportTo.
EDIT: Nope. After more testing, MoveTo does the same thing. It’s just a bit more finicky about what it will do and sometimes won’t do anything at all, which confused me. Apparently moving a prop by any means will destroy the red exclusion zone in the navmash that keeps AI out of it. Bummer.

So… anyone have any idea of why this is happening? Is it a bug that I need to report? Or is there a way for me to get that red zone in the navmesh back? :confused:

1 Like

Here’s a super simple test project that shows the issue:

using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }

navmesh_test_device := class(creative_device)
{
    @editable TestProp : creative_prop = creative_prop{}
    @editable TestButton : button_device = button_device{}

    OnBegin<override>()<suspends>:void=
    {
        Print("navmesh_test_device::OnBegin")

        TestButton.InteractedWithEvent.Subscribe(OnTestButton)
    }

    OnTestButton(Agent:agent):void=
    {
        Print("navmesh_test_device::OnTestButton")

        # This just calls TeleportTo with the exact same location that the
        # prop is already at. It doesn't matter where it is teleported to.
        PropTransform := TestProp.GetTransform()
        if( TestProp.TeleportTo[PropTransform] ) {}
    }
}

In the following clip I interact with a button, which teleports the prop on the right to the same location as to where it is already at. As you can see. The red zone around it disappears a few
seconds later.

1 Like

So the red zone never comes back afterwards ? Does it do it with different props ?

It would definitely be something to report anyways

No, it never comes back. I don’t know if that is by design or not. With that particular prop anyway, moving it by any means causes it to lose that red AI exclusion zone in the navmesh.

I decided to take your advice and just use an AI Modification Device. That works around the issue. Thanks for the help!! :slight_smile:

1 Like