#How is Entity A and B chosen for CollisionEvents?

1 messages · Page 1 of 1 (latest)

severe kernel
#

There has to be some sort of sorting going on because there's two things colliding (player and object), both of which have collision events enabled, but when I check if either objects have healthData, it's always Entity B that has this health data. Same goes when shooting a bullet at an object, the bullet is always entity B. Is it based on velocity? If so, then how come when an object collides with a stationary player, the player is still Entity B. Is it the tags?

Why can't it just be Entity A as the object and B being the thing colliding with it, then I could say only damage the player if the object is hitting the player and not the other way round.

gilded coral
#

If you use my optimised implementation of the state events apart from getting parallel implementation so significantly faster, Entity b is always the other target

#

But that's only useful if you want state stuff

#

To answer question though, I don't recall exactly but I think it's either rigidbody index or the layout order of chunks

#

Or 'randomish'

severe kernel
#

thanks Unity, very cool.

gilded coral
#

It works the same as the sample state events that are popular except for the above rules mentioned

severe kernel
gilded coral
#

License is in the root