- Home /
How to change meshcollider thickness
I want to create 2D game objects with "thick" meshcollider from below:
Please help me!!
Answer by Tomer-Barkan · Oct 11, 2013 at 07:34 PM
It seems you can attach the mesh renderer to one object, and the mesh collider to another object, which have parent/child relationship in the hierarchy. Then you can scale one of them and not the other. In your case you'd want to scale the collider larger than the renderer in the x axis, so that it pertrudes in left/right of the rendered mesh.
See here for some illustrations of how this can be done:
http://answers.unity3d.com/questions/286703/can-you-scale-a-mesh-independently-of-its-collider.html
But, the game objects "just" planes, no cubes. So, when I scale game objects, then just scale width and height except "thickness".
If it's 2D game, why do you care for the collider on the 3rd dimension? And anyway don't use mesh collider with planes... $$anonymous$$esh colliders are meant for non-trivial shapes. You can use box collider as someone here suggested.
Answer by TrickyHandz · Oct 13, 2013 at 04:41 PM
Instead of trying to use a mesh collider, you should use a box collider. That way you can scale the collider on all three axis around your object.
Your answer
Follow this Question
Related Questions
How to rotate a mesh collider? 0 Answers
Green Wireframe Length 1 Answer
2D collider wont collide with mesh 0 Answers
Ignore/Destroy then re-enable Mesh Colliders 3 Answers
Trouble with Inaccurate Mesh Collider 0 Answers