GD4.3 camera only affecting specific children.

Godot Version

4.3 stable

Question

I’m trying to have a sub area within my 2D UI where the camera can zoom in on just this sub area. So the background doesn’t change, or the UI.
I used a scene like this

ViewportContainer
|-- SubViewport
|–|–Camera2D
|–|–Objective

Where Objectives are just sprites with Collision.

And the camera works great but now the collision no longer works with the cards I’m playing outside that subviewport. I’ve found this issue, and tried a few of the workarounds. But it looks like people are saying that this is not a common thing. So I’m guessing there’s a better way to have the camera work the way I want.

Thanks, loving Godot so far. Any references or docs I should look up would be helpful.

So my answer was to put everything else on separate canvas layers. And put my camera in the root.

Looks like

root
|-- Background(CanvasLayer = -1)
|-- |-- Sprite2d
|-- Camera2d
|-- ObjectiveScene (Control)
|-- UI (CanvasLayer = 1)
|-- | – Everything else

Apparently the coordinates of mouse position get messed up when using the Viewport. Hence why the collisions were breaking.