Terrain navmesh areas based on textures

Hi all,

I’d like to make a Navmesh on a Terrain with different area types, such as “sandy” and “grass”, based on the textures I drew on the Terrain. So the part where I put a sand texture would be a “sand” navigation area.

What I want to achieve is to make different types of agents have different costs for moving over certain types of terrain. So for example, if you could have a unit that would have a low cost for moving over areas with a “Grass” texture, but a high cost for moving over areas with a “Sand” texture.

From what I gathered, the best (only?) way to really achieve this would be to create different meshes for all the ‘areas’ I’d have in my terrain and then bake the navmeshes with different area costs on those…

If I do that I’m probably better off modelling the entire terrain in Blender rather than using Unity’s Terrain object, aren’t I?

Am I correct in thinking that that would be the best (only?) way of achieving what I want to achieve here?

I thought i would share my success with a method i came up with. it works for me but it might not work for you.

alt text

what ive done is duplicated my terrain data in my assets, applied it to a new terrain. This way i have a clone of my original terrain.

alt text

In the scene i have 2 terrains stacked right on top of one another. on the terrain i want my “path” to be, i raise it up slightly above the original terrain.

alt text

alt text

after marking the “path” terrain to the correct navigation area i bake. (remember to make the cost of your “path” area cheaper than the original terrain).

alt text

Bake and its good to go. Just remember to turn off your “path” terrain and paint some paths on your original terrain. Semi-hack way to achieve this, but it works
alt text

I noticed that this was never answered. I’d love to know if this is possible as well.

I’d love to make a terrain, add some textures (grass, sand, etc) and bake it so that the different textures result in different movement costs for a nav mesh agent.