Hi, I have a scene which is have the plane and above that one cube while running the scene i push the cube object that time its collide to the plane (cube go inside the plane). I have added the one more box collider to the plane but the problem is not solved. is there any other solutions to solve this issue? Thanks.
attach Rigidbody with Both Cube as well as with Plane. use this : function OnCollisionEnter (collision : Collision) { if (collision.gameObject.tag == "Cube") { Destroy (gameObject); } } Attach this script code with plane gameobject when both collide it destroy the plane. Hope this help.
i have attached the rigidbody of both the object and another one i dont want to destroy the object, what i need is, when i apply the force to the cube it should not collide to the plane.
If you want your cube to not collide with the plane you should turn off the planes collider. If no force is being applied to the cube it shouldn't be moving and therefore should not collide with the plane. What exactly are you trying to do?
@Avo actually my plane and cube both have a collider and rigidbody. My plane collider iskinematic is true, at the runtime when i drag the cube it collide to the plane. i dont want to collide the cube to the plane. what should i do for that?
Sorry, I'm having trouble understanding you. You want other objects to collide with the cube and other objects to collide with the plane but you don't want the cube and plane to collide?
Alright, this is a multi step solution but it involves no code. 1. Select your box, click the layer in the top right corner and select add layer from the bottom of the list. Name the layer something helpful. 2. Go to Edit > Project settings > Physics Your inspector should change showing the universal physics for your scene. On the bottom of the screen there should be a triangle made out of check boxes. 3. Uncheck the check box for the default layer for your new layer. I believe this should allow your cube to pass through your plane while remaining solid.
Don't forget to assign the layer you created to your cube. And just in case check if the layer assigned to your plane is 'Default'. EDIT: Actually use the new layer for your plane too, because if you leave it at Default, the box won't collide with anything in the scene with that layer. So uncheck newLayer/newLayer in your physics settings.
I think you need a box collider on the plane. If the volume of the collider is zero it won't collide.