I have a series of levels which I’ve made as scenes, and I don’t have anything to switch between them yet. In this i have a try again button, but it seems to only work on some scenes and not others. This makes little sense, because the buttons in the different scenes use identical scripts and have identical settings, positions in the hierarchy, etc. The canvases also are in identical positions and have identical settings, and in both scenes I have an EventSystem. I have considered it might somehow be because there’s another button in the same place as the try again button, but it doesn’t seem to affect it on the other script and i can’t think of anything as a fix for a problem like that. Any ideas?
- Create an Empty
- Add A c# script
- Delete void start and void update
- Add
Example:
public void ChangeScene (int sceneToChangeTo) %|-2064817035_1|% Application.LoadLevel(sceneToChangeTo); }
- go to your button
- click +
- drag and drop your empty with the script to the on click() Event
- Click on No Funktion
- Select Script Name
- Select Change Scene Int
- Go to your build Setting put in your Scenes and at the right you can see the Scene values
- go to your button and set the value of the next side/scene
I ended up resolving it by just having the buttons move in from off screen when needed, it appears that them being on top of each other was a probem even though they were in different canvases.