I have created a script that will destroy an object when it enters a collider and instantiate another object at a spawnpoint. The only thing is that the none of the events inside the OnTriggerEnter class are going ahead.
Here is my script:
using UnityEngine;
using System.Collections;
public class Destroy : MonoBehaviour {
public bool _spawning = false;
public void OnTriggerEnter(Collider other){
_spawning = true;
Destroy(other);
GameObject _spawner;
Spawner _spawnScript;
_spawner = GameObject.Find("SkirtingSpawner");
_spawnScript = _spawner.GetComponent<Spawner>();
_spawnScript.Spawn();
}
}
I have received no errors and cannot understand why this is not working