From ba8dd72ed5ff0abdb38dccbfb505dba908002d0d Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Fri, 19 Apr 2024 03:47:34 +0200 Subject: [PATCH] Remove `target` parameter from `spawn` --- behaviours/spawner.gd | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/behaviours/spawner.gd b/behaviours/spawner.gd index 2d8319a..d4680d0 100644 --- a/behaviours/spawner.gd +++ b/behaviours/spawner.gd @@ -1,16 +1,14 @@ @icon("res://behaviours/spawner.svg") -extends Node2D +extends Area2D class_name Spawner signal spawned(entity: Node2D) @export var scene: PackedScene -@export var default_target: Node2D +@export var target: Node2D -func spawn(target: Node2D = null): - if not target: - target = default_target +func spawn(): if not target: target = MainGame.get_ancestor(self).default_spawn_parent var entity = scene.instantiate()