Unity jump from one canvas scene to another scene with canvas
I want to jump from one canvas scene to another scene with canvas in unity but i keep getting this warning
Multiple EventSystems in scene... this is not supported UnityEngine.EventSystems.EventSystem:OnEnable()
how do i solve this ??
Answer by gcoope · Jan 19, 2017 at 10:25 AM
Delete the EventSystem object in your second scene. As the error suggests you're only supposed to have one EventSystem active at a time
Answer by ScaniX · Jan 19, 2017 at 01:16 PM
You should normally be fine with one EventSystem in each scene, but it will fail if:
The GameObject with the EventSystem is DontDestroyOnLoad
You are loading the second scene additive (SceneManager.LoadScene("Scene", LoadSceneMode.Additive);)
Either change the above or remove the EventSystem from the scene that gets loaded.
$$anonymous$$mh... I saw an email with a comment, but cannot see it here or in the moderation queue, so...
DontDestroyOnLoad means that you call this method in any script on the root GameObject of the hierarchy where the EventSystem is a part of. This causes the EventSystem to stay alive even when loading a new scene nonadditive, meaning the current scene gets replaced by the new one.
Loading a scene additive means that you add all the objects of the new scene to the current one, so if both have an EventSystem, then you will end up having two of them.
If you need to load it additive AND must keep the event system in the second scene, then you should apply a singleton pattern to it. Please just look it up, there are plenty of examples here.
Your answer
Follow this Question
Related Questions
Storing playerprefs as string in inputfield.text 1 Answer
Location Does Not Change 1 Answer
dash till puff game 0 Answers
Vectrocity VectorLine Method not Making Multiple Points Line With List 1 Answer
C# Newbie Programming Questions 0 Answers