- Home /
Unity error CS1014
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);
}
}
Comment
Best Answer
Answer by robertbu · Dec 20, 2013 at 10:25 PM
'Explode' on line 30 needs the '()' appended:
void Explode() {
On line 32, 'Destroy' is misspelled.
On line 24, 'collision' needs use the lower case 'c' to refer to the variable rather than the class:
if (collision.gameObject.tag == "Enemy") {
Your answer
![](https://koobas.hobune.stream/wayback/20220613124559im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Why doesnt my script work 2 Answers
Error... that I don't understand. 3 Answers
Incremental game need help 1 Answer
What am i doing wrong in this code? 1 Answer
A node in a childnode? 1 Answer