SubViewPort size override

Godot Version

4.4.1

Question

Hello
I am trying to use the SubViewport to override the visible area of the scene, to have more room for the level items. My default viewport values are: 640x360.
In SubViewport the size I’m trying to use is 800x480, in the preview of the editor it shows correctly, but when I start the scene it shows with the default values of 640x360.
Could you please help out of what am I doing incorrectly?

Node structure:
[0]Node2d
[1]-SubViewPortContainer
[2]–SubViewPort
[3]—worldTiles
[3]—mainPlayer

Are you using a sub viewport container? You can set it’s size to what you want. There also should be a setting to stretch the sub viewport to the container size

Yes, the SubViewPortContainer, is stretched for 800x480, but when I run the scene it still shows only the 640x360 area which is set in the project settings

This is how it shows on scene run:

Hmmm… Can you post a screenshot of the sub viewport container’s inspector?

Yes.

Try setting stretch to true on the sub viewport container to true. It’ll override the sub viewport’s size and set it to its size
I hope this helps
Also, thank you for taking the time to post those

I should thank you for trying to help me :slight_smile:
That did not help, it still only shows the viewport area for 640x360 :frowning:

Sorry it didn’t work man. Hopefully someone can figure it out for you.

1 Like