Canvas Buttons not working after LevelLoad

I made a UI in the new canvas system.
The canvas is placed in the Menu screen and made into an Unity-Singleton with DontDestroyOnLoad(true). The canvas uses the “Screen Space - Camera” option.

While in menu screen everything works perfectly - the buttons get highlighted when hovered and can be clicked.
After loading a new Level the buttons do not work anymore. They don’t react on hovering or clicks.
There was no change done to the canvas while switching the level and I have no idea what is causing this trouble.

EDIT: I found a fix: somehow there was no eventsystem attached to the canvas, adding this made it work.
But I still want to know why. Why does it work without the eventsystem in the first scene and not in the second one?

Greetings,
lactus

5 Answers

5

You need one event system somewhere in your screen for the UI to work. Typically it should be on its own GameObject.

When you create a canvas the event system gameobject is created for you automatically.

I had this same issue and forgot about the event system im parented it to my canvas and I have no problems anymore thanks. On a side note the person who asked this question if its a solved issue please mark the answer correct.

It's also worth noting that if you somehow have 2 event systems in your scene the buttons will also stop working. You get a yellow warning message but it's easily missed.

i am facing the problem even if the event manager is present! plz help...

this worked for me thx :) I just added the eventSystem to DontDestroyOnLoad Object

Thank you so much!

I had the same issue, but I checked “Force Module Active” in “Standalone Input Module (Script)” in the EventSystem and it worked fine.

Tried all of these and didn’t fix it. Finally found my problem:

I’m using the standard 1st person controller asset, and it locks the cursor. Need to unlock the cursor when going back to the main menu.

In the past I have had:

  1. UI textbox/image is on top of button so it isn’t clickable
  2. DontDestroyOnLoad doing wonky things

Cheers

Thanks, fixed my issue as well.

try adding Time.timeScale = 1; at Start(){}

That´s it! Thanks!

Time.timeScale = 1 in Start method worked for me too. Much thanks!

it worked ! thanks so much i love you

I LOVE YOU !!!!!!! You literally saved my hours of searching !!

For me, it was failing because I loaded level like this:

SceneManager.LoadScene("Preview", LoadSceneMode.Additive);

But now I load it with

LoadSceneMode.Single

Don't you do it like this?: SceneManager.LoadScene("Level X") Or like this? public string levelToLoad; void Start(){ SceneManager.LoadScene(levelToLoad); }