- Home /
Objects move when changing resolution
Its a 2D game, all my sprites scale properly when I change the resolution but the objects move.
I have these blocks falling down on my title screen which creates a nice effect as they all neatly stack up. When instantiating them I specify their x and y values and when the resolutions changes, although the blocks scale in size, it seems that the x and y values stay the same.
On a smaller screen: blocks are much further apart and many are off the screen On a larger screen: blocks are created inside one another and overlap
Any help would be appreciated, thanks
Answer by LTonon · Jan 27, 2018 at 04:53 PM
I don't think the objects are moving. Instead, since you are changing the scale they seem to be further or closer between each other because of their size, you can check this by taking a look on the transform component on the Inspector. By this I mean that when you reduce the resolution, their size decreases but they maintain their distance, but the smaller size make them appear to be more distant between each other, and the same applies when you go to a higher resolution, their size increase and they overlap because of this.
Maybe this helps you, if not, there might be some other solutions to it. https://answers.unity.com/questions/641246/how-to-keep-sprite-position-the-same-despite-resol.html
Answer by lukemon577 · Apr 14, 2020 at 03:33 PM
I'm Having a problem similar to this but for my thinks are still and they re supposed to look attached and when the screen changes they move apart so they are no longer attached.
Your answer
Follow this Question
Related Questions
How to I scale UI 9-slicing across different resolutions? 2 Answers
Stretching Background sprite 4 Answers
Fixed aspect ratio/resolution independence 1 Answer
Trying to Get Our Resolution Settings to Start on the Current Resolution of the Player's Computer 0 Answers
Scale down spritesheets without breaking anything else 0 Answers