extends Node # Called every frame. ‘delta’ is the elapsed time since the previous frame. func _ready(): var texture = $SubViewportPIP1.get_texture() var texture2 = $SubViewportPIP2.get_texture() # Assigning textures to Sprite3D nodes. Allows to output the result of rendering scenes loaded to Viewport $RotatingBox/PIP1.texture = texture $RotatingBox/PIP2.texture = texture2 # Called when user input is detected in the Godot window func _input(event): if event is InputEventKey: print(event) # If the combination corresponding to the cam1 Action is pressed in the Godot window if event.is_action_pressed("cam1"): $AnimationPlayer.play("pip1->pip2") # Start animation “pip1->pip2” # If the combination corresponding to the cam2 Action is pressed in the Godot window if event.is_action_pressed("cam2"): $AnimationPlayer.play("pip2->pip1") # Start animation “pip2->pip1”