Hi I have a DontDestroyOnLoad GameObject that moves from Scene 1 to Scene 2.
I also have a GameObject in Scene 2 that has to read an int from the DontDestroyOnLoad Object.
Here is the Script DontDestroyOnLoad GameObject:
public int myInteger;
void Awake () {
DontDestroyOnLoad(gameObject);
}
void Start(){
myInteger = = Random.Range(1, 4);
}
My normal Method to read the Integer from my other GameObject would be something like:
public GameObject dontDestroyOnLoadObject;
void Update ()
{
if (dontDestroyOnLoadObject.GetComponent
↧