27-11-2020, 09:04 AM
(This post was last modified: 27-11-2020, 09:06 AM by josemendez.)
Hi Jose Carlos,
Just call GameObject.Destroy() passing the object reported by the contact.
The manual describes how to retrieve the collider involved in a contact:
http://obi.virtualmethodstudio.com/tutor...sions.html
So the code would look like this:
The script you posted pretty clearly hints at where to place it :
[RequireComponent(typeof( ObiSolver ))]
Just call GameObject.Destroy() passing the object reported by the contact.
The manual describes how to retrieve the collider involved in a contact:
http://obi.virtualmethodstudio.com/tutor...sions.html
So the code would look like this:
Code:
ObiColliderBase collider = ObiColliderWorld.GetInstance().colliderHandles[contact.other].owner;
GameObject.Destroy(collider.gameObject);
The script you posted pretty clearly hints at where to place it :
[RequireComponent(typeof( ObiSolver ))]