Using SubViewport (at all, but specifically in 3D)

Godot Version 4.2

How to use SubViewport (at all, but specifically in 3D)?

  1. How to place a SubViewport anywhere except the top left corner?
  2. How to make SubViewport size depend on the screen size instead of being fixed pixel size?
  3. How to display any objects (specifically 3D objects) within a SubViewport?

For starters,

  • it needs its own camera or it shows nothing at all,
  • and it needs Own World 3D set or it only shows the main world,

but then nothing is visible in it.

Subviewport container

Subviewport container

Add a camera and scene as child to subviewport
If it owns its own world3d. Otherwise point camera at known objects in main scene world3d

1 Like

As I already said I already did that, but the scene does not show up in the subviewport.

Did you add a environment and light source, if it owns its world3d?

Yes, I did.

Does the subviewport preview show anything? If it doesn’t then probably your sub scene isn’t setup correctly.

SubViewportContainer — Godot Engine (stable) documentation in English

The subviewport shows the environment, but no objects can be added into the environment.

Please post your scene tree and as much relevant context as possible.

1 Like

Yes, that will be nice to see.

If you can see the environment, where is the sub scene camera pointing? And does your sub viewport own its world3d, or does it share?

Using SubViewport, particularly in 3D, opens up a range of possibilities for enhancing user experience and creating dynamic visual presentations. It allows for focused displays within larger viewports, optimizing screen real estate and improving interaction. What specific aspect of SubViewport are you interested in exploring further