Tree LODs with Submeshes

Hello!

I’m creating custom tree meshes to use with the terrain engine and found that I can’t create LOD objects with multiple meshes to be painted on the terrain like so:

Tree_Pine

Tree_Pine_LOD0

Leaves
Trunk
Tree_Pine_LOD1
Tree_Pine_LOD2

Instead, each LOD needs to be a single mesh or Unity will crash while the prefab is set up in the terrain. I also noticed that with multiple submeshes like in my example, the tree isn’t given the usual LOD setup when placed directly in the scene and instead shows all game objects at once. If I add the LOD Group component to that, it doesn’t effect the objects with the “_LOD#” suffix.

Is their some way I could get this to work? I would merge them together and use two materials on each detail level but in this case, it would help a lot more to have them as separate meshes.

Thanks in advance :slight_smile:

Hi again!

I found a solution to this problem! All you would need to do is place all meshes on the same level in a group like this and save as a prefab:

Tree_Pine

Tree_Pine_LOD0
Tree_Pine_LOD1
Tree_Pine_LOD2
Leaves_Pine_LOD0
Leaves_Pine_LOD1
Leaves_Pine_LOD2

With this setup, you can maintain all sub meshes and keep the ability to paint the object to the terrain.

Hope this helps someone :slight_smile:

1 Like