New instances of object are colliding when collider is turned off.

My game’s player object explodes on collisions with enemies (objects tagged enemy). It sends a message to an object which decrements lives and then instantiates the player prefab. This new player instance is supposed to have an invulnerability period during which the collider turns off, so that it doesn’t hit anything until the period is up. The thing is, the new instances are colliding anyway. I’ve paused midgame to see that the collider is in fact, disabled. not just set to isTrigger, it’s disabled totally. I’ve even tried destroying the collider, to no avail. The object is still colliding. It has 3 children, one of which has a collider that is also disabled (always), and two objects without colliders altogether.
If I set the player object that is in the scene to begin with to have that invulnerability period (that is, check a bool newLife to true), it will not collide. it works as intended. It is only new instances that will do this. I’m really unable to figure out why these objects are colliding without colliders.

To be completely clear, during this invulnerability period, the collider is disabled. The box next to it is unchecked. Nothing I do in game, until that period ends, will turn it back on. The object acts as though the collider is enabled anyway, and only new instances do this. The object that exists within the scene on startup works properly.

Any help would be amazing. Thanks.

I’m using OnCollisionEnter() for all collision stuff.
I’ll be sure to note that’s the case next time.

Why not add a simple flag to determine invulnerability?

void OnCollisionEnter(Collision col) {
    if(!isInvulnerable) return;

    // whatever normally happens during a collision

Whenever you die and respawn, set “isInvulnerable” to true. That way when other collisions occur, they do nothing. To reset “isInVulnerable” try

IEnumerator ResetInvulnerability() {
   yield return new WaitForSeconds([WHAT EVER AMOUNT TO RESET YOU WANT]);
    isInvulnerable = false;

When you die, start this coroutinue with:


That will turn off invulnerability after whatever amount of seconds you want so when “OnCollisionEnter” occurs again, normal collisions are calculated.