- Home /
Some objects falls through Plane with mesh collider(grenade)
Hello,
I am learning Unity using a VTC course. I am at a part where i through grenades, but if my floor is a plane, then the grenades are falling through even with very slow speed settings. (grenades are generated by Insantiate and thrown from the character controller by a javascript) The character, turret does not fall through the plane, nor the grenade as a normal gameobject placed on the ground.
I was under the impression a plane with mesh collider means nothing gets through it. It seems to behave like a strange grid regarding thrown grenades. Is there any way to make the grid more dense so nothing false through it?
If i create a Cube and make it a plain plane like object, the grenade does not fall through. However I suspect the plane object does exist because cube is not intended to be used as a plane.
If i set the plain as convex the grenade does not fall through, however levitates as the convex option gives the mesh a very big and thick collider box.
I could live with convex ticked in but where I can set the size of it to perfectly fit the actual plain so no levitating objects above ground can be seen?
Thank you very much for the help in advance.
$$anonymous$$ake sure objects with mesh colliders are marked as static.
gerjonkgd: No, none of the objects are triggered. They are on default (not triggered). Also collision detection on grenade is set to discrete. (also default)
meat5000: I read about what static means, it does not affect collision, even if i set the grenade falls through. Thanks for the link to mesh colliders, now I am sure I have to use convex on either the grenade or on the plane (as both are mesh colliders). On grenade its not so bad, I mean the shape change resulted by converting into a convex and seems to do the trick (not falling through the plane). Do you know how to reduce the size of the Convex big collider box of a plane? Unity makes a much larger/thicker collider box, when plane is set to Convex. (so grenades levitate above plane if its set to convex) Thanks
Answer by alsharefeeee · Mar 18, 2014 at 09:21 AM
Simply make the Rigidbody collision detection = Continuous
I had the same problem but now it works fine.
Answer by Psycho8Vegemite · Oct 26, 2013 at 02:03 PM
I don't understand why the collisions aren't working for you, however when I was working with thrown objects in my game ie glowstick, flare... the colliders were a bit too small so that if thrown even with small force it would fall though non-thick colliders so I made the collier on the thrown objects larger and with this made the rigid body "continuos dynamic".
I still have this problem slightly when you pick up the object with a pickup script but maybe because the collider is thin thats why, maybe the falling or pushing of the object jerks its way through because it goes past the collider in the next frame making the editor think it just never actually touched it, so in simple you may have to work with a thicker collider or you could put a thicker collider on the thrown object. It seems that if you have absolute amazing fps it'll be fine else, it may jerk its way through.
Thanks for your reply. I have 60-70 fps in game. Tried to play with continous collision methods but was not lucky. Since both the plane and the grenade are mesh collided objects, according to the reference manual, one of them has to be set as convex, so they can collide.
However my issue is if I set the plane as convex the mesh collider turns to a huge flatened box, which I cannot find out how to resize to the size of the plane. So far I got the best results by doing the following:
Removing mesh collider from plane object and placing a Box collider onto it. It will be very thin by default (Y: 2.220446e-16), but work perfectly, so grenades are not falling through. List item
I set the grenade to be convex, it changes the colliding shape a bit but still acceptable.List item
The third solution would be (and best I think)if I could resize the convex plane collider box to fit the thin plane. This currently does not seem to be possible. (maybe Unity will allow this in a future release)
Your answer
Follow this Question
Related Questions
Mesh Collider falling through? 1 Answer
Plane falling through rightside of Floor 1 Answer
Detecting object inside an area. 1 Answer
Is Mesh Collider possible on an animated plane ? 0 Answers
Falling Through My Elevator.. 3 Answers