Hello,
Thanks for this life saving must-have project! I think this is my favourite asset I bought for Unity so far!
My comment or request is about Recast Graph’s tree rasterization.
TL;DR: I would like to have an option in Recast Graph’s Terrain Rasterize Trees for rasterizing only tree colliders (terrain trees without colliders won’t be rasterized with bounds). Getting the Tree Collider should be done (or should have an option for) with GetComponentInChildren instead of just GetComponent.
Long Story:
Unity 2019.3.15f1, URP, AStarPathfinding 4.3.10 Beta
I’m having some trouble lately with scanning a Recast Graph for a forest scene. Previously, I’ve rasterized trees on the terrain and it worked perfectly.
I’ve started to use NatureManufacture tree and bush assets on the terrain. I’m adding bushes as trees onto the terrain to paint them easily (using them as grass-like details don’t work for them). Now, the Recast Graph rasterizes bushes as well and I don’t want bushes to make holes on the graph, I want them to be walkable areas. The bush prefabs don’t have colliders and according to the docs, if the tree(/bush) prefab has no collider it is rasterized using it’s bounds. I’ve found this branch in RecastMeshGatherer.cs and I commented (/disabled) it.
After that, bushes don’t carve holes into the navmesh (as expected), but surprise, trees don’t carve as well. Trees have colliders on them in the prefabs, however as I found out, it’s on one of the child objects of the prefabs (it’s on the first LOD child).
In line 322, I modified GetComponent to GetComponentInChildren and now it works as I want it to work.
Thanks for reading!
Best Regards,
Dávid Szabó