Where is the "Main Thread"?

I feel like this is a dumb question, but I’m just starting out, so bare with me.

I have a script that rotates an object. The script is attached to the object. It works great. Very simple code. It’s a button, and when the button is pressed:

transform.Rotate(0, -5, 0);

But I want it to rotate a different object now, other than itself. So I tried something like this. I have another object, named literally “OtherItem”. At the top of the script that is attached to my original object, I have:

var otheritem = GameObject.Find("OtherItem");

And the button press now reads as:

otheritem.transform.Rotate(0, -5, 0);

But I get an error that reads “Find can only be called from the Main Thread”. I looked all over, and I can’t figure out where or what this “Main Thread” is. I assume somewhere there’s a sort of “Master Script” that’s not attached to any one object, or something of that nature, but I can’t find it. Sorry for the newbie question, but I just started learning, and can’t find the answer anywhere else. Thanks!

There isn’t actually any master script or anything; the error is referring to that particular script. The issue is that you can’t run that code outside of functions. It should be:

var otherItem : GameObject;

function Start () {
    otherItem = GameObject.Find("OtherItem");
}

After dealing with that for a while now, it seems to be event handler related. Many things cannot be called from eventhandlers resulting in the main thread issue, so instead use update:

bool handle = false;
void functionCalledByEvent(…){ handle = true; }
void Update()
{
if (handle){
---- do the magic here instead ----
handle = false;
}
}

I don’t know if this would be any clearer but here is how I got it to work:

 var myAudio:AudioSource ;
 var rb: Rigidbody; 
    
    function Awake()
    {
    myAudio = GetComponent(AudioSource);
    rb = GetComponent(Rigidbody);
    }