For some reason, when this script works as intended (Makes "Detonator" explode from the explosion framework plugin on contact with another object), Unity freezes. This is the script I used:
function OnTriggerEnter (other : Collider) {
gameObject.GetComponent("Detonator").Explode();
yield WaitForSeconds(2);
Destroy(this.gameObject);
}
The object that I have this script attached to does not have a detonator on it at all, but it still makes the explosion beforeit freezes. Removing the "gameObject.GetComponent("Detonator").Explode();" from the script fixes it, but I need the explosion to happen.
↧