I need help. In my pixel art game, my Viewport size is set to 640x360, and my Camera2D Node is 4x zoomed in. I’m trying to set up UI, but my Canvas Layer is shrinking to fit into the Camera2D size. The only solutions I found are either I lower the Viewport size to 160x90, Heavily oversize my UI, or having the UI be the child of my Camera2D instead of a Canvas Layer. But I don’t like any of these solutions. If there is a better solution, please tell me.
A CanvasLayer will not be affected by a Camera2D’s zoom. I can’t replicate what you describe, Can you share your scene tree?
I simply have my Canvas Layer connected to my root Node2D, with my Canvas Layer containing my UI elements. And to be more accurate, my Canvas Layer isn’t changing size at all, it is at the size of the viewport. But, due to my Camera2D being on 4x zoom, all of my UI textures appear 4x smaller than they should be on my Canvas Layer.
Is your CanvasLayer set to “Follow Viewport”?
No, “Follow Viewport” is set to false. Do you care to explain your thought process on why “Follow Viewport” might affect it?
That’s the only way I could recreate the camera’s zoom affecting the CanvasLayer children.
I think visuals would help a lot here to explain the issue. My guess is there’s something you aren’t explaining that is happening.
Apparently I missed the “Transform” in the inspector (I swear it wasn’t there before lol) I just set it to 4x scale as well and it’s fine now. Thx anyways
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.