Quantcast
Channel: Questions in topic: "dontdestroyonload"
Viewing all articles
Browse latest Browse all 416

I am wondering how to save a int in the background

$
0
0
Hi, I have been trying to make an incremental game. I just started making it, but cant figure out how to save my score in the background. I have tried useing DontDestroyOnLoad(gameObject); , but this only returns with "DontDestroyOnLoad only work for root GameObjects or components on root GameObjects." I can not figure out how to fix this. I have some ide what roots are, but i dont know how it works. So my first question is what is the root? my second question is how do i save my score.(My game works with a button getting pressed, and a number going up. This nuber can go up for example 2 /sec) So i am wondering, how do i save this number in between scenes?

Viewing all articles
Browse latest Browse all 416


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