[BUG] NPC Refuses to move to the NavigateTo() position by any means.

Summary

The NavigateTo() function sometimes does not make the NPC move to the target position, even when there are no obstacles or collisions preventing it.

Please select what you are reporting on:

Verse

What Type of Bug are you experiencing?

AI

Steps to Reproduce

  1. Create a npc behavior verse code and create a sequence of NavigateTo for the NPC to follow (mine most of the times didn’t work with negative vector3 numbers);
  2. Start the game and check the npc behavior.

Expected Result

The NPC to actually follow the NavigateTo coordinates.

Observed Result

The NPC sometimes doesn’t follow the NavigateTo coordinates even if there’s no collisions or anything in the way blocking his movement.

Platform(s)

PC (Windows 11).

Additional Notes

I’ve been trying to make this work for days now, and I can assure you that this is a bug. The road is flat, with no collisions, yet the NPC refuses to move to the NavigateTo() position by any means. Please fix it!

Can you move player to the desired coordinate and print the X, Y and Z. Then compare with coordinates you provide for your NPC. Could it be you are instructing it to travel below the ground (Check Z value)?

If you use custom floors i recommend replacing them with fortnite floors to see if it fixes the navigation issue.

Forget my earlier answer, it stopped working again, even on playtests. I’ve been trying all sorts of things in the last few hours but it really seems its a bug and there’s nothing I can do.

I did check the position by teleporting my character but it is the same and also increased the Z coordinate to be sure the NPC was above the ground, but that didn’t work either.

Yeah i’m using custom floors and pretty much everything in the map are custom assets but I also tried using Fortnite floors and it still didn’t work. He just won’t move.

Hello, did you check if your navmesh is correctly set up?

What is the value returned by NavigateTo?

Thanks!

Hey, thanks for the reply!

Yes, I checked the entire map, and the whole trajectory from point A to point B is green. Everything seems fine.

The OnNavigateErrorMessage returned the following error (screenshot below), but as I mentioned, there’s nothing blocking the path, and the entire trajectory is clear without any issues, so I don’t know why this is happening.
image

Did you teleport npc immediately after spawn? Did you use verse to spawn? Do you use streaming? Are the floors spatially loaded? Is player spawned close to npc? Can they reach the same starting and target coordinates by walking?

Yes, the NPC is teleported NavigateTo() immediately after spawning, but I’ve also tested adding a delay of a few seconds, and it made no difference.

Currently, I’m using the NPC Spawner device to spawn them, didn’t test with verse yet.

Yes, I use streaming and HLODs, and the floors are spatially loaded (also tested with fortnite floors, no difference).

The player is currently spawning very close to the NPC spawner, but I’ve also tested at various distances, and it changed nothing too.

And yes, the NPC can reach both the starting and target coordinates by walking.

Really don’t know what else to do, i’ve tried everything in the last couple days and the npc won’t move for nothing.

1 Like

Try spawing npc where you need them and make the floors not spatially loaded.

Didn’t work. Made all the floors not spatially loaded and spawned him in one of them. Still receiving NPC: Hit error moving to [22.865.447…]. Both start and target coordinates are on these floors and the Z position is very above the floor.

As you can see in the pic, both start and target points are totally achievables (These cube bps don’t have collision, i’m using them as target points)

It should not be very above the floor it should be where npc can reach by walking straight. When you enable debug draw, there should be blue square where the npc is looking to go. Can you check where it is displayed?

Yeah, what I wanted to mean is that I tested every possible z positions to be sure it wasn’t under the floor.

I checked all the trajectory (also under the floor) and didn’t find any blue square.

Try shorter distance, for example not further than the visible green navmesh, make sure therr are no obstacles.

Well, I did this and tested 8 times, only 3 of them worked.

One interesting thing I noticed is that when the NPC walks toward the target point, it doesn’t stay on a straight path. It moves slightly to the left and right instead of going directly down the middle, even though both cubes are perfectly aligned in a straight line.

What I think might be happening is that there are these ‘interruptions’ along the path that cause the NPC to move sideways, as if trying to avoid something. The longer the path, the higher the chance of encountering more ‘interruptions’, which increases the likelihood of giving me a Hit error.

The weird thing is that when visualizing Player Collision or Visibility Collision in UEFN, there are no obstacles along the path. So why would the NPC be veering sideways and giving me Hit errors almost 100% of times on longer distances?


What is the distance between your NPC and its destination?
Could you try adding intermediate positions?

Also, what are those white boxes? They don’t create holes in navmesh but seem to have physics and block navigation.

Last question: if you use a wildlife instead of a NPC, does it work?

The distance between them is 11835.58, I calculated using Distance().

Initial Position: (X=-3356.883345,Y=11903.210578,Z=1206.232634)
Target Point: (X=8478.697727,Y=11903.210579,Z=1206.232634)

What do you mean by intermediate positions? Are you referring to using NavigateTo() to move to a midpoint before reaching the final position? If so, yes—I’ve tried that in many different ways, but none worked because the NPC doesn’t move at all.

These white boxes are cube blueprints I created to make it easier to get the coordinates. I’m essentially getting their position in Verse and sending the NPC to the cube’s position using NavigateTo(). I can 100% assure that they don’t have collision and are not the problem here. When it did work, the NPC moved right through the cube.

About the wildlife, no, unfortunately it didn’t worked too. Attaching logs below.

image

Would you be able to give me a sample project so I can reproduce it? Thanks!

Sure. How can I dm you?

@Gustavo9 you should be able to click here and choose “message” on the top right. Let me know if that doesn’t work :slight_smile: