- Home /
Done Everyyyy thing but OnCollision is not working!!
I have done the following things but OnCollision is not working: 1) Added Rigidbody to both the Objects 2) Added Box colliders to the objects (isTrigger (Unchecked). 3) Restarted the Unity 4) Restarted the System
how do you observe that it's not working? how are colliding them?
By Calling this Function in script: void OnCollisionEnter(Collision cd){ Debug.LogError("Name:"+cd.gameObject.tag); Debug.LogError("Called"); }
Answer by Bip901 · May 20, 2018 at 11:45 AM
Make sure there are no other colliders between them which may interrupt the collision. Make sure both objects are in the same layer (not sure it's necessary, but you can try) . Uncheck "isKinematic " in both rigidbodies. Make sure they are moving at a slow pace - sometime if an object is small enough and moving fast enough it will move right through the collider.
That's all I can think about, good luck solving the problem! ~Bip
Thanks alot . I have made both objects is$$anonymous$$inematic. It appeared that I need to uncheck atleast one Object's is$$anonymous$$inematic.
Your answer
Follow this Question
Related Questions
Collision with part of mesh collider only 1 Answer
If two of the same objects spawn on top of each other, is it possible to destroy only one? 0 Answers
Deteching collsions when jumping when not using a rigidbody 2 Answers
Using Collider and Rigidbodies for simple collision detection 0 Answers
Can't detect isgrounded? Help 1 Answer