- Home /
GameObjects not changing position and size when using diffrent screen sizes
So , my problem is that when ever I change a screen size and resolution my objects sizes and positions stay fixed .
Main Camera size dosent change and my objects dont change at all .
Im making a game on 1080p monitor and when I go to test it on my android phone more then half of scene is not in the screen and nothing changes size .
Any tips how to change them . I tried putting all of my gameobjects in 1 and scaling that objects by main cameras size but problem is that local main camera size dosent move .
Answer by salex100m · Jan 02, 2017 at 08:29 PM
I don't think you EVER want to scale your GameObjects related to the camera screen size.
You need to change the camera position so that it captures all the objects that you want to render with your starting position. If your map is just one size and you want to render teh whole thing, than it should be easier. Just play with the camera settings until it works for the android screen size.
Look up the camera API and you can then program the camera to auto scale correctly, instead of its default auto scaling. Here are some of the things you'll want to play with camera.aspect camera.depth camera.fieldOfView
However, if you REALLY REALLY want to scale objects according to camera.fieldOfView... (I wouldn't recommend it) but just add a scalar to all your GameObjects and say scalar = camera.fieldOfView and then scale the size of each object in your game according to that scalar. Again, this is probably NOT what you want.