So I’m watching a tutorial on how to make own FPS game, because I want to learn Unity but I get this error message but the person in the video not. I’m still new to C# and I can’t figure out what’s wrong… Here is the code:
using UnityEngine;
using System.Collections;
public class bullet_ThermalDetonator : MonoBehaviour {
float lifespan = 3.0f;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
lifespan -= Time.deltaTime;
if(lifespan <= 0) {
Explode();
}
}
void OnCollisionEnter(Collision collision) {
if (Collision.gameObject.tag == "Enemy") {
Destroy (collision.gameObject);
Destroy (gameObject);
}
}
void Explode {
Dsestroy(gameObject);
}
}