SlimeoosOdyssey/godot/Level/World/DayNightEnvironment.gd

17 lines
319 B
GDScript3
Raw Normal View History

2023-08-20 16:49:08 -06:00
extends Node3D
var we = [
preload("res://Level/World/world_environment.tscn"),
preload("res://Level/World/world_environment2.tscn"),
]
var current = null
func _ready():
randomize_env()
func randomize_env():
if current:
current.queue_free()
current = we[randi() % we.size()].instantiate()
add_child(current)