Is It Possible To Generate NavMesh Areas from Terrain Textures?
I'm just in the senario where I don't want sea creatures (that spawn off an ocean terrain texture via Crux) to come out of the water and chase the player on land. I've been searching for an answer but i'm unsure if there are any solutions for this.
Any help would be much appreciated, thanks!
Answer by b1gry4n · May 26, 2018 at 11:29 PM
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.
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.
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.
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).
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
@b1gry4n It is not clear what you're actually doing or using to mark your path in the cloned terrain. What tools are you using? What settings are you using when baking the navmesh?
Oh dang thats brillaint! Can't believe I didn't think of this! I've been using beziers which takes a long time to get right. I award thee with my only point.
Answer by IgorAherne · Mar 28, 2017 at 05:24 AM
Not possible, but possible with a hack :)
get a mesh of your terrain via:
http://wiki.unity3d.com/index.php?title=TerrainObjExporter
.
In any 3d modeling package, delete any polygons which would have water texture.
Import the remaining mesh polygons back into unity, match position of the mesh with the terrain's position
Set Terrain as AI non-static.
set mesh as AI static + optionally assign an AI-layer from the "Layers" tab in Unity's AI pathfinidng panel
bake
Disable the adjusted mesh so it's not visible (or get rid of it entirely)
Your answer
Follow this Question
Related Questions
Navmesh baking on objects it shouldn't. 0 Answers
Very slow NavMesh baking with multiple terrains 1 Answer
Baking Navmesh at runtime freezes the game for a couple seconds 1 Answer
How can i get a mesh of the navmesh I have baked? 0 Answers
Typical baking time for navigation on large terrains? 1 Answer