- Home /
Rotating a MeshCollider
When I import a 3D model in Unity from Blender, it often has a strange scale and/or rotation. To fix that issue, I used to wrap the object into an empty game object. This way, the parent game object would have default transform values (i.e 0 position, 0 rotation and 1 scale) and the child game object would be scaled and rotated so that the object looks as intended (without having a rotation/scale on the parent).
However this work around is causing me problems now. I have some kind of "gravity generator" object. This object has a trigger BoxCollider and applies a force of any object having a Rigidbody that enters its box collider.
My problem, since I'm wrapping the MeshCollider (and the MeshRenderer/Filter) into a child object and the Rigidbody on the parent object, the Collider and the Rigidbody are not located on the same object. Thus, when my gravity generator detects another collider, it can't apply gravity on it, because the rigidbody isn't on the detected object, but on it's parent instead !
So, what can I do in order to have a Rigidbody and a MeshCollider on the same object with a "corrected" rotation/scale for the collider ?
Thank you.