18 lines
386 B
GDScript3
18 lines
386 B
GDScript3
|
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
|
||
|
|
||
|
|
||
|
|