- Home /
How to place 3d objects in a 2d sceen and adjusting for screen resolution
Hello, I am new to Unity and looking for advice on how to position 3d objects in front of an orthographic camera.
I have a canvas, with a canvas scaler set to scale with screen width, reference resolution 1920x1080. I have a child game object on the canvas which is an image with height and width of 1920x1080. My camera is orthographic, size 5.
I have developed my game with a 16:9 aspect ratio, positioning my 3d game objects to line up with my background image (see attachment with 3d cubes in front of the orange circles which is the background image). I position my 3d game objects by specifying coordinates of the transform e.g. new Vector2(7.13f, 1.90f).
Everything is working as I expect. Now I want to enhance my game to allow users to window and rescale the running game. When the aspect ratio changes the image rescales, but the 3d objects are no longer aligned. See second image in the attachment (aspect ratio 16:10).
How do you place 3d objects in front of the background image, and re-align those objects to stay fixed to the position of the background image (ie stay on top of the orange circle in my case).
Your answer
Follow this Question
Related Questions
I have problems with the Camera.ortographic to adapt the view to screens with different resolutions. 2 Answers
Orthello Sprite Depth inconsistent for large levels 0 Answers
How does resolution work in 2D and orthographic camera 1 Answer
How to blur objects based on distance from the camera using Unity's optimized blur effect? 0 Answers