Y
Y
Yura Mailler2021-01-19 15:33:16
Unity
Yura Mailler, 2021-01-19 15:33:16

How to resize canvas through code?

Hello ! During the test of the game, I noticed that the screen resolution does not match with some devices, how can I change the screen size with a code?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DANICH70, 2021-01-20
@DANICH70

The code is not necessary, in the canvas there is a section "Render mode", and there select "Screen space - camera". Next, put "Main Camera" a little lower in "Render camera". Now the canvas will always be under the camera size.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question