NavMesh and Heightmap?

Hello,
I’m currently trying to make a little RPG for a class project and I would like to know if it is possible to use a navmesh on a ground from a heightmap. With this navmesh, I would like to split an island on different parts to have the mobs “freely” walking on their part of the island and also to limit the player to the island border and not going underwater and drowning.
So my question is : Is it possible to make a NavMesh on a ground from heightmap and how? And if not what can I do to make anything similar ?

@Cedric who is the king of the navmesh :slight_smile:

1 Like

Yes it works for heightmap. Let me share my secret PG. :smiley: Use checkbox to control troops with different colors.

https://playground.babylonjs.com/#X5XCVT#319

I haven’t tested navmesh with water yet. I planed to build the shape of the water as a custom mesh and uses it as obstacle. But I don’t know if there is better way of doing it.

Actually I notice that in my terrain, I modified the river bank height values to be like this image: http://images.gamedev.net/features/programming/randomriver/image002.jpg. If the river bank has very steep slope, navmesh will not allow going across. But unfortunately my generated terrain also has slopes that are safe to walk into the river. So I was thinking to build the custom mesh of river/lake shape as obstacle.

4 Likes

Ok thanks a lot the navmesh works for my island (but not the water for now), I just need to adjust parameters now.

1 Like