Hi y'all
I tried several ways with and without prefab and several references, but it seems every time I hit the play button, the reference goes missing.
Other scripts/references work. Does anyone know how to fix this?
public class Meltdownphase : MonoBehaviour
{
public ActionListAsset MeltdownSequenz = null;
public Volume volume;
// Start is called before the first frame update
private void Awake()
{
GlobalVariables GlobalVariables = GetComponent<GlobalVariables>();
MeltdownSequenz = (ActionListAsset)Resources.Load("MeltdownSequenz") as ActionListAsset;
}
// Update is called once per frame
void Update()
{
if (AC.GlobalVariables.GetBooleanValue(10)){
Debug.Log("MELTDOWN");
MeltdownSequenz.Interact();
}
}
}
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
The issue is that your "MeltdownSequenz" variable is both public (so can be assigned in the Inspector), but also reassigned in your Awake function by attempting to load a file from Resources into it.
If you've assigned the correct asset in the Inspector, comment out the line:
Ah, jeesh. That was exactly the problem!
Sorry and thank you very much!!