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!