I have two gameobjects with have the exact same script attached to both of them. I would like one of the gameobjects’s script’s values equal the other gameobjects’s script’s values. But I keep getting the error the left hand side must contain a proper indexer. What am I doing wrong?
public class SomeScript1 : MonoBehaviour {
public gameobject someGameObject1;
public gameobject someGameObject2;
void Start(){
//Both Gameobjects contain the script SomeScript2
someGameObject1.GetComponent<SomeScript2>() = someGameObject2.GetComponent<SomeScript2>();
}
}