Obi Official Forum

Full Version: How to code function to get collided gameobject?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello. Thanks for nice physic plugin.

I need to detect gameobject which collides with Obi cloth, Obi tearable cloth.

I searched and found this:

[url=http://obi.virtualmethodstudio.com/tutorials/scriptingcollisions.html]

I'm not skilled on Obi cloth, so can I ask how to code function to get collided gameobject?

Thanks in advance SonrisaSonrisa
(27-10-2017, 09:09 AM)skywaver Wrote: [ -> ]Hello. Thanks for nice physic plugin.

I need to detect gameobject which collides with Obi cloth, Obi tearable cloth.

I searched and found this:

[url=http://obi.virtualmethodstudio.com/tutorials/scriptingcollisions.html]

I'm not skilled on Obi cloth, so can I ask how to code function to get collided gameobject?

Thanks in advance SonrisaSonrisa

It's right there in the link:


Code:
Collider collider;
if (ObiCollider.idToCollider.TryGetValue(contact.other,out collider)){
// do anything you want with "collider"
}

cheers!