The problem is on line 20 but as I have little knowledge on scripting i'm not sure what the problem is.
using UnityEngine;
using System.Collections;
public class DestroyScript : MonoBehaviour
{
public GameObject Explosion;
public int scoreValue;
private GameController gameController;
void OnTriggerEnter (Collider Other)
{
if(Other.tag == "Player")
{
Instantiate (Explosion,transform.position, transform.rotation);
Destroy(gameObject);
gameController.AddScore (scoreValue);
}
}
}
↧