07-12-2020, 09:19 AM
(This post was last modified: 07-12-2020, 09:20 AM by josemendez.)
(05-12-2020, 11:21 PM)VirtualCucumber Wrote: I just updated from 5.3 and so far the changes look amazing, especially with the back-ends but I used:
This is scrapped in the new updates. I see the new CollisionEventHandler class but I'm wondering how can get the other collider from the contacts.Data[i].other field.Code:Component collider;
if (ObiCollider.idToCollider.TryGetValue(e.contacts.Data[i].other,out collider)){
// Function to do when particle collides with collider
}
Hi there,
contacts.Data[i].other is now just an index into the ObiColliderWorld's colliderHandles array. Retrieving a collider no longer involves looking it up in a dictionary. Quoting from the manual:
http://obi.virtualmethodstudio.com/tutor...sions.html
Retrieving the collider involved in a contact
You can get a reference to the collider involved in any contact by doing:
Code:
ObiColliderBase collider = ObiColliderWorld.GetInstance().colliderHandles[contact.other].owner;