Can't Get gameobject with GameObject.Find, and access its scripts

Hey There!

I am trying to get a find a gameobject so I can tell it to change its boolean to true.
It’s easier to describe in code:

GO = GameObject.Find("tempp");//find the Gamobject
GO.CardScript.main_card = true;//set the gameobject as the main card 

I get the error:
Assets/Scripts/CardHandler.cs(18,36): error CS1061: Type UnityEngine.GameObject' does not contain a definition for CardScript’ and no extension method CardScript' of type UnityEngine.GameObject’ could be found (are you missing a using directive or an assembly reference?)

How can I do this correctly? I’ve theorized and tried a few methods, but this should be trivial…

GO.GetComponent().main_card = true;
See GetComponent.

Thank you for your help.

I can’t remember how I solved the issue, but I ended up doing it with a different method.
I do see however, that your answer would have worked too.
This will come in handy :slight_smile:

Again, thank you