Use Cube1 x value, add 10.3 and set the value to Cube2 . How would I do this?

transform.position = new Vector3(Cube1.transform.position.x,transform.position.y,0);

^^Where or how would I use (Cube1 x value + 10.3) where i have written ‘Cube1.transform.position.x’ ?

edit: is the problem that i am not referencing it or something?
how do i reference another objects position from anothers script?

Is it possible to do it like this?


GameObject cube1 = GameObject.Find (“Cube1”);

transform.position = new Vector3(cube1.transform.position.x-10.3f,transform.position.y,0);
did the trick.