0 votes

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".

in Engine by (15 points)

1 Answer

0 votes
Best answer

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://godotengine.org/qa/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.

by (699 points)
selected by

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.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.