Hey guys, sometimes when I add a box collider component it boxes the perimeter of the object perfectly, and sometimes it just weirdly mispositioned and the scale is way off and then I have to fix it manually. Is there a simple automatic tool that makes the box collider always in the correct position and scale so I won’t have to do it manually?
Resetting the collider didn’t work?
What do you mean by resetting? Doing it manually? Yea I can do it manually, but I just don’t understand why sometimes the box collider is set appropriately for some models, and for other models it’s way off. It can take a loooong time if you need to do it to a lot of models.
Are you adding the colliders through a script?
If you are adding the box colliders manually through the editor, then I’m wondering if it has something to do with the models you are importing. Could you provide a screenshot?
it is bit annoying, since it doesn’t automatically take account the size of child gameobjects…(pretty sure editor some small script could fix that)
Adding box collider to empty transform root, it wont take child objects size
Adding box collider to gameobject with mesh, correct size
Ah, now I see what you mean
But yeah, like you also guessed, writing a script is probably the way to go
Here is an older thread, but with the right direction: Auto-sizing primitive collider based on child meshes - Questions & Answers - Unity Discussions
Sara, looks like mgear provided the screenshots for me. I’m not adding the colliders through script for the record.
Any ideas where I might find such scripts?
I tried adding a mesh renderer before adding the box collider - didn’t help.
Thanks! the link you provided helped me find the appropriate editor script. I appreciate it ![]()

