How can i spawn an explosion?

Hi, i downloaded the Explosion framework, and now i want to load it at a spawn point. I want that the user touches a cube and then the spawn point spawns the explosion.

The spawn point is called "Spawn1" The prefab "explode" Im very new with unity, an im not so good, but i have this script:

function OnTriggerEnter(other: Collider) { if (other.CompareTag("Player")) { //what i have to inseret there? } }

From skimming the code which comes with the Detonator package, it seems you simply have to create an instance of one of the detonator prefab explosions (which are provided in the "Prefab Examples" folder), using the Instantiate function. Eg:

var exp : GameObject = Instantiate (explosionPrefab, position, Quaternion.identity);

This assumes that 'explosionPrefab' is a reference to one of the example prefabs, or one of your own custom detonator prefabs. 'position' should be a Vector3 representing where you want the explosion. You might just want to use "other.transform.position" for this value, if you want the explosion to occur at the 'other' object's location.

And then, it appears as though you also have to ensure the explosion object is cleaned up yourself too, by using something like this:

Destroy(exp, explosionLife);

Where 'explosionLife' is the number of seconds after which the explosion instance will be destroyed and removed from the scene.

For a more detailed example, just look through the "DetonatorText.js" script which comes with the package. In it, the function "SpawnExplosion()" uses a RayCast to determine where in the scene the explosion should occur (based on the mouse position), and then creates an explosion at that point. (actually at a point slightly away from the surface of what was clicked).

So, your final code might contain something like this:

// near the top, with your other var declarations:
var explosionPrefab : GameObject;
var explosionLife : float = 10;

// then later, your trigger enter handler:
function OnTriggerEnter(other: Collider) {
    if (other.CompareTag("Player")) {
        var expPos = other.transform.position;
        var exp : GameObject = Instantiate (explosionPrefab, expPos, Quaternion.identity);
        Destroy(exp, explosionLife);
    }
}

Hope this helps you get started.