changing collider to is trigger after death still allows for one or two collisions??

Hi,

I don’t know if it’s a unity bug, but I’m trying to avoid players gaining extra points by shooting a player that has just died and I’m doing it by changing the dead players collider to isTrigger. I can see in the inspector that it changes as soon as the player dies, but some missiles fire very rapidly and are already close to hitting the dead player when isTrigger becomes true on the dead player and that cause an extra collision to be detected for some reason.

I really need to know how to avoid any collision detection on a dead player, but above mentioned method isn’t working perfectly. Does anybody have any suggestions or maybe you’ve encountered the same issue and found a solution? All help is greatly appreciated, thank you

Make sure that you don’t award anything if the player is already dead.

1 Like

You’re likely seeing multiple collisions in the same physics update. Any changes to the physics will only apply to the next physics update. If the first of these collisions kill the player, you’ll still get messages for the other collisions, even if you’ve changed the collider to a trigger.

As @Chris-Trueman pointed out, you need to ignore additional collisions that get reported after your player died (maybe you already have a variable or checking collision.collider.isTrigger in the OnCollisionEnter callback should work as well).

2 Likes