class_name GameController extends Node2D signal teleportSignal(body:RigidBody2D) signal destroySignal(Body) # Called when the node enters the scene tree for the first time. func _ready() -> void: get_window().grab_focus() # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta: float) -> void: pass func _on_trigger(effect: Variant, Object: Variant) -> void: print ("Game controller knows about trigger") match effect: "destroy": if not Object is Player: destroySignal.emit(Object) "teleport": print("Trigger wants to teleport") if Object is Crate : teleportSignal.emit(Object) #Object.teleport_to() func _on_bullet_hit(body,bullet)-> void: print ("GC knows bullet hit") if body is Crate: destroySignal.emit(body) destroySignal.emit(bullet)