How To Fix Parsing Errors
using UnityEngine; using System.Collections;
public class Fallout : MonoBehaviour {
public int lives = 5;
public Transform respawn;
public Transform fallout;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void OnTriggerEnter(Collider other)
{
if(other.transform == fallout)
{
transform.position = respawn.position;
lives-=1
}
}
}
Comment
Sorry, But To Add On, This Is A Script For Dying, But Unity Says There Are Some Errors, Can Someone Help $$anonymous$$e Please? Thank You Very $$anonymous$$uch!!! :)
Answer by Paulo-Henrique025 · Oct 23, 2015 at 09:12 PM
Always post the error Unity is giving you, you can copy/paste from the Console.
Format your question properly, some of the code is outside the code block, making it appear as plain text
Search before posting a new question, parsing errors are quite common around.
The error is probably related to missing a ';' in the end of statements or missing closing/opening of braces { }.
I can see that lives-=1
has no ending ;