Terrain:Clear() removes navigationmesh from later loaded terrain

After using Terrain:Clear(), the NavigationMesh completely ignores any non-water terrain (using new shorelines)

How to reproduce (in runtime)

  1. save terrain using Terrain:CopyRegion()
  2. use Terrain:Clear()
  3. load it back using Terrain:PasteRegion()

Expected behaviour: Reload the NavigationMesh, including the pasted in Terrain
Behaviour: NavigationMesh ignores the pasted in Terrain

Why is this an issue? Games that need both pathfinding and terrain saving/loading in runtime have to use workarounds that impair performance.

2 Likes

We’ve filed a ticket into our internal database for this issue, and we will update you when we have further information!

Thanks for the report!

2 Likes

This is definitely not the intended behavior. We’ll look into it. Would you mind sharing a simplified placefile that exhibits this issue? Thanks!

1 Like


that’s my game after reloading the terrain, the only difference is that in the second picture I did not use workspace.Terrain:Clear().

though I just realised the issue does not occur anymore when simplifying it.

maybe my mistake, sorry if so. I can update you as I find out more

keep attention to the command bar and output.

I am afraid I cannot reproduce what you are seeing. Here’s the steps I’m taking:

  1. Open the attached place: TerrainNavClearing.rbxl (49.9 KB)
  2. Press “run”
  3. Observe that it has tested the path, then cleared and then restored the terrain.
  4. Observe the output window text.
  5. Notice it says (in the end):
  15:11:23.610  After clearing:  -  Server - Script:26
  15:11:23.758  Enum.PathStatus.Success  -  Server - Script:29

If you are still seeing the same issue, please provide repro steps with the same level of detail as above so we can reproduce this on our side and fix the problem. Thanks!

1 Like