Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | theOtherHolmes |
I have a 2D scene with two viewports, each inside side-by-side viewport containers. The viewports are showing a 3D scene (“Prism-2”), which currently has just a simple prism mesh. Attached to the prism mesh are two camera, one that shows it from the front and one that shows it from the side. I want the viewport on the left to show the front camera and the viewport on the right to show the side camera. See screenshot:
![Side-by-Side Viewports][1]
I cannot figure out how to do this. I tried the following script attached to Viewport_Side but it didn’t work:
extends Viewport
onready var camera_front = $"Prism-2/Camera_Front";
onready var camera_side = $"Prism-2/Camera_Side";
func _ready():
camera_front.current = false;
camera_side.current = true;
Any help?
[1]: file:///Users/brian/Dropbox/Brian/Godot%20Projects/SVGs/ViewportScreenShot.png
Per @SIsilicon, my image link isn’t working, so try this:
Side-by-Side Viewports
https://drive.google.com/file/d/1YTt8f95UM_yE8OWK6Fixx_FCSvN2DlGW/view?usp=sharing
theOtherHolmes | 2018-09-16 23:03
You know, I just realized something. The code you are showing doesn’t have the keyword tool
. Which would mean that the code was not running in the editor at all.
SIsilicon | 2018-09-17 00:27
True, although it doesn’t work when I build and run the game either. But thanks for the reminder that I can test it in the editor too. I added the tool
keyword. Still the same result.
theOtherHolmes | 2018-09-17 01:23