Hi, I’m new to unity and i got my script but it’s not working and i can’t find the reason can someone help me?
This is my script:
C#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GameEnd : MonoBehaviour {
public GameObject CanvasIG;
public GameObject CanvasEnd;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void OnTriggerEnter(Collider EndPad)
{
if (EndPad.gameObject.tag == "Player") {
CanvasIG.GameObject.SetActive (false);
CanvasEnd.GameObject.SetActive (true);
} else {
}
}
}
That code should make a canvas appear and anotherone disappear when the player is colliding with an object.
Thank you in advanced.