Ignore awake function call to destroy game object if character enters trigger

Hey guys, running into a small issue here and I’m trying to find an effective way to resolve this. Upon awake I call the game object to be destroyed after 4 seconds. If the player enters the trigger of that game object he will take damage and a layer collision will be applied to prevent the player from taking more than one hit for 2 seconds at which point I reactivate the layer collision so the player can take damage again. I’m wondering if the reactivation of the layer collision is not taking place because the game object is destroyed before that reactivation is occurring. Anyone have any ideas? Maybe it’s something simple. Here is the code. Thanks!

#pragma strict
#pragma downcast

var canHit = true;
var Hit : AudioClip;

function Awake() {
Destroy (gameObject, 4.0);
}

function OnTriggerEnter(other : Collider) {
var renderers = GetComponentsInChildren(Renderer);
if (gameObject != null) {
if (other.tag == "Parent" && canHit) {
other.SendMessage("Life",SendMessageOptions.DontRequireReceiver);
canHit = false;
other.audio.PlayOneShot(Hit);
for (var r : Renderer in renderers) {
    r.enabled = false;
}
Physics.IgnoreLayerCollision(9, 10, true);
yield WaitForSeconds(2);
Physics.IgnoreLayerCollision(9, 10, false);
Destroy(gameObject);
}
}
}

Yes the coroutine will stop when the game object it destroyed. Instead make the latter part of the code a separate coroutine on the player and run it there…