Hi everyone!
so far in my programming, I have been using the unity interface/debug to make objects acces other objects scripts.
for an example:
using UnityEngine;
using System.Collections;
public class shadow : MonoBehaviour {
public idea Idea;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if(Idea.shadow1 == true)
{
transform.position = new Vector3(4,7,0);
}
}
}
setting a variable for idea-script, then I’ve set the object it’s linked to in the Unity object inspector.
but now I’ve come to a problem. The object that holds the variables has “DontDestroyOnLoad” to exist in even when I change scene. but if the variables will be reset if I put this object in every scene I need to refer the code.
is there another way to acces the variables?