gm = GameObject.FindGameObjectsWithTag(“GameManager”).GetComponent();
why is get component not working here
gm = GameObject.FindGameObjectsWithTag(“GameManager”).GetComponent();
why is get component not working here
I suspect that is because there is an “s” in “FindGameObjectsWithTag”, so it is returning an array of GameObjects with that specific tag. Remove the s. You should also remove the GetComponent(); part.
GameObject gm;
gm = GameObject.FindGameObjectWithTag("GameManager");
I still have an error saying
"cannont implicitly convert type ‘UnityEngine.GameObject’ to ‘GameManager’ "
GameManager = gm;
//…
gm = GameObject.FindGameObjectWithTag("GameManager").GetComponent<GameManager>();
you must define what component you want to access.
@rap7ure Do you still need help if you found the answer could you please tell me?