I’m trying to activate a gameobject from another gameobject but console gives this error:
UnassignedReferenceException: The variable back of activateScript has not been assigned.
You probably need to assign the activateThisvariable of the activateScript script in the inspector. activateScript .Update () (at Assets/Model/activateScript .cs:13)
I’m just using that:
public class activateScript: MonoBehaviour {
public GameObject activateThis;
void Start () {
activateThis.SetActive(true);
}
}
I may be a complete retard, but in my project I have a simple script for any dynamic object in a level.
the most used function in it is to destroy(disable) one object/set,
and enable another.
both sets are enabled at startup in the scene,
but the objects labeled enable(that are enabled at the end of the function) gets disabled in the start method of the script.
what I mean to say is (and here is where the idoit warning comes)
is that I believe unity culls the inactive scene objects at runtime.
so if they are enabled at start but disabled the first frame of gameplay,
they can be enabled on call.