Can anyone tell me why? The collider size also does not seem to be affected by the Y scale. EDIT Note: I haven't accepted one of the answers below as I was referring to two meshes both with convex set. It seems it's not possible to over ride the size of a mesh collider on built in objects.
(comments are locked)
|
|
because a collider should have a value greater than zero in all directions. a plane is a plane of vertices with normals and even is not visible from the opposite side but colliders are shapes and their calculation has nothing to do with the mesh. as you understand the plane has no thickness because it's just a series of vertices with their normal in same direction. there is not a real world shape for them in 3D and you can not find anything with only one side available in real world so their collider shape should be a verry thin box like shape. Hi Thanks for the explanation and I agree a very "thin" box like shape would be fine but the collider added is very thick. If you do the test you will see what I mean. IF it could be scaled in the "y" direction that wold help a lot.
Nov 21 '09 at 07:41 PM
ibyte
(comments are locked)
|
|
When you add a collider component to an object with a mesh, the collider auto-sizes to fit the mesh, but that's just a convenience. You can adjust the size of the collider manually in the inspector, in the collider's "size" property - see the Box Collider section of the Unity manual (in the Reference section). Mesh collider's don't have this property.
Nov 22 '09 at 02:24 PM
ibyte
(comments are locked)
|
|
Replace the Mesh Collider on the Plane with a Box Collider. It will fit your plane, and you can adjust the Y thickness (I tested 0.001, which still stopped a falling rigidbody). But tunneling still occur easily if the object falling is thin or is moving fast. (Worst case being thin and fast).
Dec 04 '09 at 09:23 AM
Statement ♦♦
That is a general issue with using such a narrow object for collision. If it was essential, you could always decrease the time interval of checking the physics engine (Edit > Project Settings > Time > Fixed Timestep). If it was a platform, you could offset the collider downward so that the top matches the surface, but it has seveal units of thickness below.
Dec 04 '09 at 10:29 AM
Novodantis 1
(comments are locked)
|
|
A possible "work around" to my question is to create and resize a cube to match the size of the plane. Of course this add's more vertices/faces but at least the collider will match the shape of the cube even if I make it extremely thin. you can easily change properties of a collider like it's size and center and ... you can use a plane and use any type of collider you want with customized properties and size. you can even use a sphere collider and there is no limitation. the created collider is just for making the process easy.
Nov 22 '09 at 02:33 AM
Ashkan_gc
Mesh collider's don't have size and center properties. I noted this from the Unity help "The Mesh Collider builds its collision representation from the Mesh attached to the GameObject, and reads the properties of the attached Transform to set its position and scale correctly." So it would seem since it can't be zero the next increment of one full Unity unit which for my purposes is way too big.
Nov 22 '09 at 02:25 PM
ibyte
(comments are locked)
|
