- Home /
Object dos not match with the mesh collider
The mesh collider component doesn't line up with the object itself, I tried to make an empty object and add the mesh collider to the empty object, but it didn't work so... the error appeared when in the original object added the mesh collider compoment and..you can see it in the image:
Answer by TreyH · Apr 13, 2018 at 09:03 PM
You've checked IsConvex
. Uncheck that to get your actual model.
Convex is an optimizer that will reduce poly count on your actual collider by removing gaps / holes.
As for why it's rotated, you might have an import error with the mesh itself? Did you make it in blender, by chance?
Also note that the model seems to have an animation. So it's possible that the animation actually changes the orientation. Further more keep in $$anonymous$$d that a mesh collider is never "skinned". You can't have a mesh collider on an animated model that deforms with the model.
Answer by bunnynsnake · Apr 13, 2018 at 08:13 PM
The mesh collider will take on the shape of whatever mesh is plugged into it. You have to plug in the correct mesh for it to work properly. Also, if it is a complex mesh, and you need it to be complex, make sure you have "convex" and "smooth sphere collider" unchecked.
it's up to you to make sure you've got the proper mesh attached.
To set the mesh of a mesh collider, simply select the "mesh" field in the mesh collider component in the inspector and edit it.
Go here for more information on mesh colliders.
Yes, i already do that, but the mesh is inverted, -90 degrees rotated (Y possition), and i can't change it, don't know how. No necesarily complex mesh. Thanks you anyway, by now i used a box collider xd
Your answer
Follow this Question
Related Questions
Mesh collider without Rigidbodies 1 Answer
Unity 5 Mesh Triggers - OnTriggerEnter / OnTriggerExit called repeatedly 1 Answer
Tiling problem: how to know where to put next tile? 1 Answer
Workaround for Non-convex MeshCollider cannot be used as a trigger in Unity 5 0 Answers
Gameobject falls through terrain when instantiated, but original does not 0 Answers