level.gd 291 B

12345678910
  1. extends Node3D
  2. # Random spawn of Rigidbody cubes.
  3. func _on_SpawnTimer_timeout() -> void:
  4. var new_rb: RigidBody3D = preload("res://cube_rigidbody.tscn").instantiate()
  5. new_rb.position.y = 15
  6. new_rb.position.x = randf_range(-5, 5)
  7. new_rb.position.z = randf_range(-5, 5)
  8. add_child(new_rb)