AltParty2024/scripts/balls.gd
2024-10-10 18:43:23 +03:00

18 lines
386 B
GDScript

extends Node3D
@onready var pallo: PackedScene = load("res://assets/ball.tscn")
# Called when the node enters the scene tree for the first time.
func _on_timer_timeout() -> void:
var x: float = randf_range(-2, 2)
var z: float = randf_range(-2, 2)
var boll: Node3D = pallo.instantiate()
var spawn: Vector3 = Vector3(x, 10, z)
add_child(boll)
boll.global_position = spawn