06-05-2024, 05:38 PM
(06-05-2024, 04:48 PM)josemendez Wrote: Hi,
Now I understand your confusion, collision callbacks don't work the way you seem to expect. See:
http://obi.virtualmethodstudio.com/manua...sions.html
When you subscribe to OnCollision, you get a list of all contacts between particles and colliders in the solver. For each individual contact, you can tell the specific particle and collider involved in that contact. This allows you to process the contacts in parallel should you need to, which is a lot more efficient than having them scattered across function calls to multiple objects like Unity does, specially if you have thousands of contacts every frame.
The system will send the collision event to whatever object(s) you subscribe to the OnCollision event. So typically you subscribe just one object (doesn't matter which one) to OnCollision, then process all contacts just once and perform whatever logic you need depending on the particle/collider involved in each contact.
kind regards,
Thanks, that cleared up my confusion.
I understand now, so the system can only output contacts in its solver (which has any type of ObiActor). In case of the Cube which is just an Obi Collider it can't know the attacker who added force on it, since it cannot query any contacts in its solver.
Is there any workaround for this?