Get the relative dimensions of two different canvases
Hi everyone,
I have an issue that I still wasn't able to solve. In my application I have two canvases, one, the main one, is a screen space-camera canvas with the main camera attached on it. The second one is child of a Game Object in a far world position, like (4000, -15, 4000) and it's a world space canvas, this canvas also has a camera on it, which has a certain position (0, 200, 0) relative to the game object container.
With my second canvas I'm creating a RenderTexture that I'm passing on my main canvas, inside the raw image, to visualize the things I have on my canvas and also on the other children of the container.
Now, the question is, how can I calculate properly the size of the objects on the second canvas? Like I need to understand how many pixels they are, relative to my UI canvas. As of now all the sizes are different, like, a 100x100 object on my first canvas results way more little than a 100x100 object on my second one.
Thanks for your help, I hope I was clear in explaining the issue and the setup.
Your answer
Follow this Question
Related Questions
Take XYZ of GameObject and convert that to canvas co-ordinates? 0 Answers
RectTransform.localPosition = Vector3 Not setting correctly 0 Answers
hey im trying to make a pause menu, it keeps poping up at the start and i have no idea how to fix. 1 Answer
Problems with Canvas and ui elements scaling at runtime 0 Answers
Canvas scale 0 Answers