I can’t figure it out. What it wrong with it? The error is at InvisWallBackComp.enabled = false;
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class Finish : MonoBehaviour {
public GameObject InvisWall;
public GameObject InvisWallBack;
public Text WinText;
public int laps;
public GameObject Player;
public Component InvisWallBackComp;
public Component InvisWallComp;
void start() {
InvisWall = GameObject.Find (“InvisibleWall”);
InvisWallBack = GameObject.Find (“InvisibleWallBack”);
InvisWallBackComp = InvisWallBack.GetComponent ();
InvisWallComp = InvisWall.GetComponent ();
laps = -1;
NumberOfLaps ();
}
void Update () {
InvisWallBackComp.enabled = false;
}
void OnTriggerEnter2D(Collider2D other) {
laps = laps + 1;
NumberOfLaps ();
}
void NumberOfLaps () {
WinText.text = "Lap: " + laps.ToString ();
}
}