diff options
Diffstat (limited to 'ship/ship/ViewPorts.gd')
-rw-r--r-- | ship/ship/ViewPorts.gd | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ship/ship/ViewPorts.gd b/ship/ship/ViewPorts.gd new file mode 100644 index 0000000..2e8e800 --- /dev/null +++ b/ship/ship/ViewPorts.gd @@ -0,0 +1,15 @@ +extends Spatial + +var camera_locations = [] + +func _ready(): + for viewport in self.get_children(): + var cam = viewport.get_node("Camera") + camera_locations.push_back(cam.global_transform) + +func _physics_process(_delta): + for i in self.get_child_count(): + var viewport = self.get_child(i) + var cam = viewport.get_node("Camera") + cam.global_transform = camera_locations[i] + cam.global_transform = self.global_transform * cam.global_transform |