I have figured out the array to store my animations in, and I can get them to change basic on the player’s level with a global signal. But my problem is that the enemy spawner does not alter the enemies, it is still spawning the old enemy. The enemies on the screen change, but the enemies spawning does not. I believe the problem is because the spawner is preloading the enemy scene. So my question is, what is a better way of doing this? if you need more information I can provide it.
spawners are marker2d with a timer,
script
extends Node2D
var enemy_scene = preload(“res://Scenes/enemies.tscn”) # this is the problem
var enemy_spawn_points =
@onready var main = get_node(“/root/Game”)
Called when the node enters the scene tree for the first time.
func _ready():
for makers in get_children():
if makers is Marker2D:
enemy_spawn_points.append(makers)
func _on_timer_timeout():
var spawn = enemy_spawn_points[randi() % enemy_spawn_points.size()]
var enemy_level_one = enemy_scene.instantiate()
enemy_level_one.position = spawn.position
main.add_child(enemy_level_one)
Thanks