Quantcast
Channel: Latest Questions by studentvz
Viewing all articles
Browse latest Browse all 14

Button OnClick() after Scene restart is Missing (Object)

$
0
0
Hello, I have a GameObject with AudioSource and script which have this piece of code: void Awake () { if (!instance) { instance = this; } else { Destroy (this.gameObject); } DontDestroyOnLoad (this.gameObject); } I have also other methods, and main purpouse of this gameobject is to hold clips and play it by calling methods. When I add this GameObject to my Button OnClick() it works fine, but if I restart scene then there is no that GameObject assigned to Button OnCLick(), it says: Missing (Object). Why is this happening?

Viewing all articles
Browse latest Browse all 14

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>