- Home /
Scale objects to fit screen unity
I have a row of 3 objects (instantiated in a script). and I want to decide how big each object should be so that for all screen sizes they will take the same ratio and fit inside the screen.
The prefab they are instantiated from is a cube of unit 1 in all axes.
I want to get how much pixels are per unit for that prefab and divide the screen width by that value. the result will be the objects new scale
how can I get the pixels per unit? or is there a better way to do what I want?
thanks!
Comment