Properly positioning and scaling planes for GUI

I found planes to be the best GUI solution since they support shaders , they have really good performance and support all the events. At the moment I have a second camera with higher depth that’s rendering the GUI with some planes.

However , there is a problem with positioning and scaling planes so they look the same on all resolutions. I tried to make a formula that can scale the planes based on Screen.width but it seems resolution scaling ratio is not linear and it doesn’t work good.

I’ve seen some scripts but none of them work for me.

If you are not yet capable of coding a fully working solution for this you should look at one of the existing GUI frameworks to get your work done , some are even free such as UIToolkit by prime31.

IF you want to do it yourself then by all means go for it. Is your second camera set to orthographic rendering? Secondly it probably better to be using layers to separate GUI rendering from the other camera’s instead of depth . Changing size and layout would be based on formulas using screen dimensions - it does work.

I have hands and torso near the camera , so they intersect with the gui if i don’t use second camera :wink:

Where did I say dont use a second camera …? I didnt. I made mention of using layers to separate GUI items from the rest of your scene instead of only using depth. If all your GUI items are assigned to a unique layer and your extra camera for GUI set to only render items in this layer and your other scene camera set to exclude this layer, then set you GUI camera depth above the scene camera and then all GUI items will always be rendered above the scene items …

hth