Detonator extension

i got the Detonator extension for unity and i cant figure out when u attache it to an empty game object and get it to explode when u have your character walk into it. in the intro of my game i need a lot of explosions but only when your character walks into a certain spot.

thanks :slight_smile:

You can attach a script to the object the explosion is paired with and check the distance between that object and the player. Once the player is within a certain range, trigger the explosion.

public GameObject explosionPrefab;
void Update() {
    if(Vector3.Distance(transform.position, GameObject.FindGameObjectWithTag("Player").transform.position) < "insert Range Here") {
        Instantiate(explosionPrefab, transform.position, Quaternion.identity);

Just tag the player as โ€œPlayerโ€ and this should work if you plug in the rest of the variables.