- Home /
UI canvas gets copied when changing scene
Hey guys, I have created 2 scene, scene1 has a button to change scene to scene2. In play mode when I click on the button, canvas from scene1 gets copied to the scene2 which I don't want at all. Any help would be appreciated.
Answer by FortisVenaliter · May 05, 2016 at 03:24 PM
Nothing should be copied from one scene to another unless you have a code script that calls DontDestroyOnLoad() on the gameobject, so you might search for that in your code.
Alternately, are you sure that Scene 2 does not just contain an identical canvas?
Thanks that helped, I was using DontDestroyOnLoad() for wrong object.
Answer by Nazirzadeh · May 06, 2016 at 09:12 AM
One more thing: If you have static variable in your code, after loading new scene it will not be destroyed too. be aware of that :)
Your answer
![](https://koobas.hobune.stream/wayback/20220612080215im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Old scene still appears for short time when switching scene 0 Answers
Fadeout Issue 0 Answers
When I move a UI.Canvas this symbol appears in it. What does it mean and why is it appearing? 1 Answer
Facebook Canvas strange behaviors 0 Answers
How to animate 2d characater Avatar (Portrait) whit dynamic changes. 0 Answers