Auto-sizing colliders upon creation.

In the Project tab:

  1. I import a model.
  2. I create a new empty prefab.
  3. I drag the model onto the new prefab. Adds a “default” sub-item, examples: alt text

The divergence:

I select the prefab, add a Box Collider. The collider is always a size of 1x1x1. I have to manually set the box size, scripts work great.

I select the default sub-item, add a Box Collider. The Box Collider is auto-sized correctly. However, it breaks all my scripts… because the box isn’t where the Unity expects them to be.

What IS this default sub-item? It appears to be “inheritance” of the model, sorta. How do I get the benefit of the auto-sizing box without using the default sub-item?

EDIT: Removed humor, added clarity.

Thanks!

Can you be more specific? What 'default thingy'? The only thing I see on screen when prefab is selected is Layer: Default If you are adding a Box Collider Component, you don't get the sizing handles, you have to type the size into the Inspector AFAIK.

1 Answer

1

You may find it easier to develop your prefab in the Hierarchy, only dragging it to the Project when it is ready. That way you’ll actually see it in the Scene view, hopefully it will then make more sense (and you’ll be able to use screenshots rather than “thingy” to describe unfamiliar things.