extends Node2D # Called when the node enters the scene tree for the first time. func _ready(): var texture = $SubViewport.get_texture() # Retrieving the texture from Viewport $Sprite2D.texture = texture # Assign a texture to the Sprite2D node, to output the render result of the scene loaded to Viewport # 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 if event.is_action_pressed("cam1"): $SubViewport/Node3D/AnimationPlayer.play("map_animation") # Launches “map_animation” in the AnimationPlayer node from the scene loaded to SubViewport.