Hi
I’m trying to organize my variables into groups by making a serialized class and then using them in another, but it gives me errors saying the variables I declared in the serialized class don’t exist. Here’s the code I’m using
[System.Serializable]
public class DisplayOptions
{
public bool ViewInGame = false;
public bool ViewInEditor = false;
}
public class NewGameObject : MonoBehaviour {
public DisplayOptions displayOptions;
protected void Update()
{
GetComponent<MeshRenderer>().enabled = ViewInGame;
}
}
Okay I change it to GetComponent<MeshRenderer>().enabled = displayOptions.ViewInGame; still has this error error CS0103: The Name 'ViewInGame' does not exist in current context
– RiskyBiscuitGamesNVM it worked forget to change another reference to it thanks
– RiskyBiscuitGames