I’m a beginner so I don’t know if the answer is obvious or not. So I’m making a game and I have a coin GameObject and it is also assigned to a public static GameObject variable called coin1 in a script called GameStats. When I want to change the position of that GameObject from another script, I write: GameStats.coin1.transform.position = new Vector3(Random.Range(1, 4), Random.Range(-0.35f, 0.3f), 0.3f);
. In debug mode, the transform.position variable changes but not in the Unity scene. How do I fix this?
EDIT: I also tried doing:
GameStats.coin1.transform.position.Set(Random.Range(1, 4), Random.Range(-0.35f, 0.3f), 0.3f);
GameObject.Find("Coin").transform.position = new Vector3(Random.Range(1, 4), Random.Range(-0.35f, 0.3f), 0.3f);
And
GameObject.Find("Coin").transform.position.Set(Random.Range(1, 4), Random.Range(-0.35f, 0.3f), 0.3f);
But none of them worked.