Node/camera setup for a _Moraff's World_-like?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By amonroejj

YouTube video of Moraff’s World gameplay

What would the node setup look like to have four separate first-person cameras facing north, south, east, west (that move in tandem as a single unit), plus a top-down minimap?

I tried:

Control
+--ViewportContainer (supposed to be looking north)
    +--Viewport
        +--(instanced 3d scene)
+--ViewportContainer (supposed to be looking south)
    +--Viewport
        +--(another instance of the same 3d scene)

But the instanced 3d scene can only have one Current camera, so unsurprisingly I just get two identical views.

In Unity, this is pretty trivial because you can just throw in the cameras and set each camera’s screen real estate coverage on a 0.0-1.0 scale. You don’t have to worry about viewports or “current”.

:bust_in_silhouette: Reply From: gmaps

So the solution is to have one main scene (not multiple instances of it) and have multiple viewports inside your scene, like this:

(instanced 3d scene)
	+--ViewportContainer (supposed to be looking north)
    		+--Viewport
        		+--Camera
	+--ViewportContainer (supposed to be looking south)
    		+--Viewport
        		+--Camera

Here is an answer to a similar question:

https://forum.godotengine.org/50032/multiple-camera-from-different-angles-one-scene-the-same-time

Having viewports may seem as unnecessary, but it allows you more control over the resulting render of each camera. There is always a tradeoff between simplicity and control.

Thanks. That (mostly) worked.

  • The north camera doesn’t render in designer for some reason, although
    it does when playing the scene with F6. EDIT: restarting the editor fixed this.

  • You can no longer parent all the cameras to an Empty to easily move
    them as a group. EDIT: A script on the empty can handle this.

amonroejj | 2019-10-21 12:50