this is my script and its giving me error why?
Unexpected symbol < class struct or interface
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class MovementScript : MonoBehaviour {
public Slider healthBarSlider; //reference for slider
public Text gameOverText; //reference for text
private bool isGameOver = false; //flag to see if game is over
void Start(){
gameOverText.enabled = false; //disable GameOver text on start
}
// Update is called once per frame
void Update () {
//check if game is over i.e., health is greater than 0
if(!isGameOver)
transform.Translate(Input.GetAxis(“Horizontal”)Time.deltaTime10f, 0, 0); //get input
}
//Check if player enters/stays on the fire
void OnTriggerStay(Collider other){
//if player triggers fire object and health is greater than 0
if(other.gameObject.name==“Fire” && healthBarSlider.value>0){
healthBarSlider.value -=.011f; //reduce health
}
else{
isGameOver = true; //set game over to true
gameOverText.enabled = true; //enable GameOver text
}
}
}
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class MovementScript : MonoBehaviour
{
public Slider healthBarSlider; //reference for slider
public Text gameOverText; //reference for text
private bool isGameOver = false; //flag to see if game is over
void Start()
{
gameOverText.enabled = false; //disable GameOver text on start
}
void Update ()
{
//check if game is over i.e., health is greater than 0 if(!isGameOver)
transform.Translate(Input.GetAxis("Horizontal")*Time.deltaTime*10f, 0, 0); //get input
}
void OnTriggerStay(Collider other) //Check if player enters/stays on the fire
{
//if player triggers fire object and health is greater than 0
if(other.gameObject.name=="Fire" && healthBarSlider.value>0)
{
healthBarSlider.value -=.011f; //reduce health
}
else
{
isGameOver = true; //set game over to true gameOverText.enabled = true; //enable GameOver text
}
}
}
Only compiler error I’m getting is - (and that can be ignored technically)
Assets/test.cs(10,22): warning CS0414: The private field `MovementScript.isGameOver’ is assigned but its value is never used
???