1
Fork 0
mirror of https://github.com/Steffo99/swear-jar.git synced 2024-11-26 01:24:19 +00:00
swear-jar/spawner/spawner.gd
2023-10-01 00:25:13 +02:00

12 lines
276 B
GDScript

extends Node2D
class_name Spawner
@export var scene: PackedScene
@export var target_parent: NodePath
func spawn():
if len($Area.get_overlapping_bodies()) > 0:
return
var scene_instant = scene.instantiate()
scene_instant.position=Vector2.ZERO
add_child(scene_instant)