My Code:
GameObject ComposterUI;
private void Start()
{
ComposterUI = FindObjectOfType<CompostUISetting>().gameObject;
}
The gameObject I’m trying to reference is a UI Canvas. That’s attached to a gameobject as a child of a child.
I thought finding the script and accessing the gameObject would be the fastest, but I’m stuck. I’m trying to access it from an instantiated prefab.
I’ve found an other forum post where they referenced the gameObject from a component. So I’m not sure why this is not working.
I’ve been reading the Unity manual on UI and there was a line: It is a GameObject-based UI system that uses Components and…
If it’s a gameObject based system than it should have GameObjects right?