I have a hub scene, and in the hub scene if I click on the start game option and start the game the button works fine. If I click first on any of the other options and then click on the start game. The button does not work.
I have restarted both Unity and my machine. It does not make a difference.
My scene is set up with waypoints, I click on a cube and it brings me to a settings menu, I click back, and click on the start game, start game will not load. I do not get any errors. The button just does not respond.
I can post screen shots of my hierarchy and my hubManager script when I get home tonight. Any help will be greatly appreciated.
Thank you.
Edit
Here is the HubManager script which has the OnClick event.
Scene Set up.
If I click anywhere else before clicking to start the mission, the start mission does not work.
Clicking on a cube moves the main camera to face it and brings up a menu. So far on the main cube has any buttons. The other cubes will have some soon.
*** EDIT - Resolved ***
I got it working.
I turned on BlockRaycasts. But never turned it off. I turned on / off intractable. That is what through me off. I was so focused on it being intractable that I overlooked it Blocking Raycasts.
Thank you all for you help and suggestions. It really helped me a lot.
It does sound like you have an issue in your code where you loose the connection between the scripts and the button callbacks.
Maybe you want to try and recreate the connection fo the buttons runtime by adding delegates to OnClick on an instance of the button every time it’s shown.
I did pause an check. What should be intractable is, and I am at a loss. I think I might re-delete the button. Add it again and hope that it was just a defective button…
I have a feeling somehow the hierarchy is what is up. Not sure.
Just one thing comes to mind. What if you move WarTableMenu under the other menu objects in hierarchy? If it works with that fix, it might mean that the FadeMenu() function is at fault for not hiding the other frames correctly. They may be blocking raycast still if you only set them transparent with alpha 0. (Don’t know that code)
I turned on BlockRaycasts. But never turned it off. I turned on / off intractable. That is what through me off. I was so focused on it being intractable that I overlooked it Blocking Raycasts.
Thank you all for you help and suggestions. It really helped me a lot.