How do I stop assets from moving position after compile?


I have simple scene with a single image in it - I set its Width and Height according to the image size and I set X and Y to 0 in an attempt to center the image.

My problem is twofold:

  • When I compile and run the scene, the image seems to have moved from where it was in the editor game preview.

  • I can’t seem to center my image based on X resolution.

Could someone please point me into the right direction?

Sounds like its because of a resolution change.

The proper way to do this is to anchor the image to the center of the canvas (which should be set to screen space), and set the stretch mode to the corners of the screen. That way, the image will be the same size no matter the resolution of the monitor.

Hope this helps,