TowerGame/scripts/spawner.gd

21 lines
465 B
GDScript3
Raw Normal View History

2025-04-26 16:02:13 +01:00
extends Node3D
2025-06-10 13:34:26 +01:00
class_name Spawner
2025-04-26 16:02:13 +01:00
@export var spawn_scene: PackedScene = null
2025-06-10 13:34:26 +01:00
#@export var spawn_time: float = 5.0
@export var enabled: bool = true
2025-04-26 16:02:13 +01:00
2025-06-10 13:34:26 +01:00
func spawn() -> void:
var node: Node = spawn_scene.instantiate()
add_child(node)
if node is Node3D:
(node as Node3D).global_position = global_position
2025-04-26 16:02:13 +01:00
2025-06-10 13:34:26 +01:00
#var spawn_timer: float = 0.0
#
#func _process(delta: float) -> void:
#spawn_timer += delta
#if spawn_timer >= spawn_time:
#spawn_timer -= spawn_time
#