Play button works on first time. When the player come back to menu, the button don't work.

I have a big headache with this problem.

On my project the player can activate 3 different endings. When the player reach some of these endings,
the game should take the player back to the menu scene. And when the player comeback to the menu, play button don’t work.

I don’t forgot the event system on my menu scene.

If instead of take player back to the menu, i use SceneManager.LoadScene(“LevelOne”) after the player activate one of the three endings, everything works good. My problem is only when i try reload the menu.

I already tried to check and uncheck Force Module Active on event system.

I already tried to put Time Scale= 1 in one of my scripts(i don’t know if i wrote the code correct, i just set time scale to one on start method).

I already tried use a game object on the scene and also a prefab to be a reference for OnClick on inspector.

I already tried to use a older version of unity to test this problem, and nothing change.

I think that i am missing some important thing of ui.

I am sad with that situation.

Perhaps there is something invisible in front of it that is marked RaycastTarget ?

If you make a UI.Text, by default it IS set to RaycastTarget, so even if it is not covering something with text, the rectangle can block.

When you hover the mouse cursor over the play button, does it “glow” or “darken?”

IF not, make a NEW button (at runtime, just trash in the scene)… does it hover?

If not, move the NEW button up to the VERY top layer… does it hover?

If those buttons work, then at RUNTIME, connect the new button to your PLAYGAME function… does it work?

ALSO: at runtime, maybe start deleteing things from the menu, make sure nothing is in front or blocking something.

I know you will find it!

Solved!

Thanks Kurt but the problem was on script of first person controller that i get on asset store.

If you are using a type of first person controller asset and nothing was solved like me, you have to check the camera movement script on this asset.

In my case, the asset mini first person controller was disabling the cursor when the player returns to the main menu scene. So if you have this problem, you have to change the asset script, and menu will work.

1 Like