Hello, i’m trying to activate a GUI menu when the player enters a trigger. Its so when the player enters the final platform of the level, a GUI Canvas appears on the screen and allows the player to hit continue in order to go to the next level.
My script doesn’t get any errors, but does not seem to work and i cannot figure out why…
Here is the script:
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class triggerGUI : MonoBehaviour {
public Canvas retryMenu;
void update()
{
retryMenu = retryMenu.GetComponent<Canvas>();
retryMenu.enabled = false;
}
void OnTriggerEnter(Collider other)
{
retryMenu.enabled = true;
}
}
Any ideas on what’s wrong ?