Question by
kevmpaterson · Aug 19, 2017 at 06:04 AM ·
buttondontdestroyonloadonclick
On Click Missing Audio Object when Scene changes
Not sure if this is a common problem, but it has been frustrating me for hours.
I have a Main Menu. Two Buttons. Play and Exit
I assign an on Click Event to the play an audio when clicked.
The Audio Source is a GameObject that I have a Do Not Destroy on load script attached to it.
When I change scenes and press by pressing play and and then change scenes again to come back to the main menu, the button loses the Game Object and says Missing Object.
Why does this occur even though the Game Object is not destroyed. Is it a different instance of this Game Object or something and Unity can't see it anymore?
button1.jpg
(47.8 kB)
buttonreload.jpg
(115.3 kB)
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612133047im_/https://answers.unity.com/themes/thub/images/avi.jpg)