I have a Car, whocar that needs a Box Colliderbox collider. If
If the car would bewere 1 single mesh, iI would only need to call:
and it would create a boxCollider, which fitsBoxCollider that perfectly fits my car, based on my car's mesh.
Now I have a car which existsconsists of many different parts in the transformation hierarchy. (forFor example: Bodythe body of the car is the parent of the 4 doors. Every door is 1 seperate gameobjecta separate game object, and has a doorknob child, etc. )
now iNow I need a script whichthat changes the boxColliderBoxCollider so, that it has theits box surroundingsurrounds the whole car, including all of these parts.
, but it just doesntdoesn't get me the right collider.
Edit: I just tried again - and the Boxcollider staysHere is the same.code I'm using: