Fixing Gameobject to the right of another Gameobject

Right now the cube is placed right of the sphere. But when I make an Android APK and move around, the cube stays at the right but it changes position.

I want the cube to stay where it is spawned and not move with the camera.

Good day.

You are not giving enought info to solve the problem, but i explain you some things:

If a GameObject (lets call it ObjectA) is child of another (Object B), we say ObjectB is parent of ObjectA. Now, ObjectA will move/rotate/scale as a part of ObjectB;

The other thing i want to explain is the difference between transform.location and transform.Localposition.

As their name says, transform.location is the position in worldspace. If ObjectA position is 0,0,0 it will be placed at the center of the worldspace.

Localposition is the position relative to is parent, so if ObjectA localposition is 0,0,0 it will be placed at the center of ObjectB.

OF course, if ObjectA has no parents, Localposition is the same as position.

So, If you need to place a Object to the right of another object, make 1st Object become child of the 2nd and use the Localposition


First, i don’t know how camera goes on Unity. I supose it does not detect/calculate coordinates when the image moves…

So first you need to know the coordinates of points in the images, to calculate the relative position while camera moves, i supose the camera image is just like a “backgroud video”, so Unity does not see how much is moving, you need some scrip`t to detect movement of the camera via analizyng the image.

Once you can know the coordinates of a point in the image changes while camera is moving, you will be able to calculate how to move the square.

If helped, accept tha answer! :D