16 lines
371 B
GDScript3
16 lines
371 B
GDScript3
|
extends Node3D
|
||
|
|
||
|
@export var spawn_scene: PackedScene = null
|
||
|
@export var spawn_time: float = 5.0
|
||
|
|
||
|
var spawn_timer: float = 0.0
|
||
|
|
||
|
func _process(delta: float) -> void:
|
||
|
spawn_timer += delta
|
||
|
if spawn_timer >= spawn_time:
|
||
|
spawn_timer -= spawn_time
|
||
|
var node: Node = spawn_scene.instantiate()
|
||
|
add_child(node)
|
||
|
if node is Node3D:
|
||
|
node.global_position = global_position
|