- Home /
Convert Canvas Scale to World Scale
I'm instantiating an object in 3D space that I want to have the same scale as one of my objects being drawn on the canvas for my camera.
Both objects use the same image, but that's irrelevant.
Thoughts?
Thanks!
Can you please post the screenshot. It will help us to figure it out easliy.
The circle on the right was made in 3D space, the star on the bottom in the corner is a UI sprite.
I want the star in 3D space to have the same scale as the star on the UI canvas.
Thanks for the screenshot. It helped a lot.
Now there are some question in my $$anonymous$$d Like , ''Why you need 3D and Ui image different ", "Can't We find/fix the same with using the same either using both 3D or Ui", "Is the star is co$$anonymous$$g right position, because It doesn't seems to be ???".. so I think I don't know the exact solution or approach, so I'm not the right person to answer.
But I want to try once ;)
Now the first idea which came in my $$anonymous$$d is :- One thing is that I will do is I will instantiate the same ( either both UI sprite or Both of them 3D) to achieve the solution ..
you might need to do some Research to find the solution
Sorry for not providing the exact solution :(
Hi, have you found a solution for this? I'm currently facing the same problem, I think.
I think what I did was I just made the prefab for the star gameobject that was in 3D space be the same size as the star gameobject that was on the UI. And then I just made sure that the star on the UI was always the same size regardless of the device size.
This was quite a long time ago
Answer by xxkajperxx · Feb 05, 2016 at 02:45 AM
to edit the scale of an 3D object you can go into the edit tab and go into scale tool
I know how to edit the scale. I'm trying to keep the scale of a 3D object the same as an object being drawn by my canvas through code.
If I were to just outright say that the scale of the 3D object (lossyScale) should be = to the scale of the object being drawn on the canvas (also lossyScale), then the 3D object would actually be really really tiny since the canvas is using pixels to draw the object. Pixels in 3D space however is ridiculously tiny.