I'm hard stuck on a problem, not sure what to do. I notice that the Camera2D size is set to the game's viewport size. However, I am needing a Camera2D to film a space that is not the game's viewport size so that I can use it as a viewport texture in 3D.

The problem is that there is no way to set the Camera's size, which is extremely surprising as one would think this would be a very basic feature of any game engine.

Please do not suggest altering the zoom. This is a bad solution because a) it will warp the pixels on the screen, and b) after changing the zoom, the camera size still looks the same in the viewport, which is really confusing and bad.

Surely this can be done right? Am I really stuck with one camera size and that's it?

Here is the answer:

As it turns out, in 2D camera are not actually cameras. They are just windows that display a viewport. So you can't change the size of the camera because there is no camera, you can only change the size of the viewport.

If you are using a SubViewport, you can change the size of the SubViewport, and that will effectively change the size of the camera.

In my opinion, this is a badly designed system. It is a very obvious violation of heuristic #2 of the famous N/N usability heuristics (https://www.nngroup.com/articles/ten-usability-heuristics/). If you call something a camera, it should be a camera. If it is a window of a viewport, then call it that instead. Ideally, the program would have been designed such that there are true 2D camera that behave like cameras do, meaning that you can change the size of the camera as needed. Maybe it's not too late to fix this, I'm not sure.