1
Fork 0
mirror of https://github.com/Steffo99/swear-jar.git synced 2024-11-25 00:54:19 +00:00
swear-jar/spawner/spawner.gd

12 lines
274 B
GDScript3
Raw Normal View History

2023-09-30 18:16:14 +00:00
extends Node2D
class_name Spawner
@export var scene: PackedScene
@export var target_parent: NodePath
func spawn():
2023-09-30 22:05:15 +00:00
if len($Area.get_overlapping_bodies()) > 0:
2023-09-30 20:53:38 +00:00
return
var scene_instant = scene.instantiate()
2023-09-30 18:16:14 +00:00
scene_instant.position=Vector2.ZERO
add_child(scene_instant)