- Home /
Collider on an empty object or a cube?
When I make a collider such as walls, I make an empty GameObject then add a Box Collider and it works fine. But when I look how AngryBots is made, I see that the colliders are a cube GameObject, with a Box Collider. But the Cube is left at its default size, only the Box Collider is resized to the actual desired effect. The Mesh Renderer of the Cube is not active because, of course, you don't want to see it.
Now, I wonder why AngryBots is made like that and not simply with empty GameObjects? Should I change my project? And, why? TIA!
Answer by whydoidoit · Mar 25, 2013 at 12:48 PM
It's so you can easily see them by turning on the renderers - it helps with debugging.
But then Transform would be scaled and the box collider left at 1,1,1 (which I agree is good for positioning the darn things.)
If you watch new users, they just tend to go right for the BoxCollider sizes (which makes sense -- it isn't obvious that colliders inherit the Transform scale.) I'm thinking that's the point. AngryBots is meant to be easy to understand for new users.
AngryBots is certainly an interesting complex project, not necessarily the way I'd do things though... However, I'm just looking at my rendered colliders right now to see what's wrong in the game view!
Well, I am a new user and I find it confusing. The manual says that, to make a compound colliders, you should make children objects and attach a primitive collider to them. I understand it as, empty GameObjects.
Incidentally, I made a ship simulator, compiled for Adobe Flash. About one hour after running the simulator, all my browsers crash with a Fatal Error Null message. Unity3D QA is informed and "working on it." $$anonymous$$eanwhile, I try to simplify my codes to see if it causes a memory/array/buffer overflow of some kind. This is why I compare "my way" with "AngryBots' way" ... :-)
Well I make basic capsules, spheres and cubes - as I say - very much easier to see what's going to be hit.
Perhaps but I started program$$anonymous$$g my Commodore Pet with only 32 $$anonymous$$b in 1979 and for me, a byte too much is a byte too much! ;-) This is also my comments to object-oriented program$$anonymous$$g: it demands muuuuuch too many codes. But I understand that, when several people are working together at one project, it is the only way to "firewall" different routines. In my book, less is more! ;-)