Setting up Tree Collisions

Ok so I instantiated all the tree prefabs into the Scene View, added Capsule Colliders, and made these GameObjects into new Prefabs.

Only now the old prefabs without the colliders seem to hold the mesh which the new prefabs need. So the problem is that I now have two prefabs for each tree (the old ones without capsule colliders, and the new ones with capsule colliders), and if I delete the old prefabs, the new prefabs lose their mesh. This is an awful waste of space to have the project contain both the old and new prefabs. Is there anyway to get rid of the old prefabs (without colliders), while making sure the new ones (with colliders) still work? Thanks!

When you delete the old prefab does only the mesh go away?

If so, can you drag the imported tree mesh onto the mesh component in the new prefab?

Yes, when I delete the old prefab, the mesh in the new prefab can no longer be found. The mesh components attached to the old prefabs are also the same mesh components in the new prefabs.

I also cannot move the mesh to the new prefab. It for some reason wants to stay with the old original prefab. The goal is to have prefabs with capsule colliders attached to them. Perhaps the old prefabs should have had the capsule colliders attached to them, instead of making new prefabs to attach the capsule colliders to?

Did you keep your tree imports?

Maybe Unity is holding onto the tree data through the prefab if you deleted the import.

Anyways, what you could have done was drag out your prefab into the scene view, then add a collider component (therefor loosing the prefab) and then applied that object to the prefab you already had.

Or you can even select the prefab in the project pane, and then add the collider right there.

I deleted the original tree prefabs, and then realized the mesh was missing from the new prefabs with the colliders. I then reimported the old tree prefabs, and clicked the “update the tree details” button, then everything worked fine again. I really didn’t want two sets of trees.

I have to slap my forehead and say “Doh!”. :lol:

That was the first thought that crossed my mind, but I was following the instructions I found posted all over the place about how to add colliders to trees. I’ll just add colliders to the old original prefabs. Duh! Thanks!

The only problem is I’ll have to redo all the trees since I used the new prefabs as the trees in my scene.

I think my problem is that what I’m calling the original prefabs are actually models and that’s probably why I can’t change the first few settings in the inspector, or add components like capsule colliders. I think you must first create prefabs from the tree models in order to add the capsule collider to the tree. I also discovered that you should replace the mesh collider with the capsule collider for the trees in the prefab.