- Home /
Unity Event System not functional!
Hello, recently I had 2 canvas's a pause menu and a main menu. Only the main menu will work as the main menu is the only menu being detected/triggered with all of the functions on it the event system. So, in attempt to solve the issue i deleted all my menus, components, even my event system attached and remade everything. Now when i create a new canvas I see it comes with an event system but when i try to use a button to detect hover or click nothing happens when i do so.... The event system is not detecting anything after numerous times re-importing the event system and my canvas/panels etc into the scene.
I do have a pause menu script that opens the menu up when escape button is pressed but i dont think that might be the issue.
Here is the script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class PauseMenu : MonoBehaviour
{
[SerializeField]
private GameObject Menu;
public static bool pausemenuOn;
void Start ()
{
pausemenuOn = false;
}
void Update()
{
if (Input.GetKeyDown(KeyCode.Escape))
{
pausemenuOn = !pausemenuOn;
}
if(pausemenuOn)
{
Menu.SetActive(true);
Time.timeScale = 0;
}
else if(!pausemenuOn)
{
Menu.SetActive(false);
Time.timeScale = 1;
}
}
}
I have the script set on the camera. The script does work. as it does open up my menu but as said above the hover and click events for the buttons aren't being triggered. idk why.