For context, I was going through the tutorials for Alien Attack and everything seemed to work fine up until I got to the Enemy Spawner Scene. In the tutorial, they asked us to delete the enemy that we had started with in game scene. After I did that and added this code:
func spawn_enemy():
var spawn_positions_array = spawn_positions.get_children()
var random_spawn_position= spawn_positions_array.pick_random()
var enemy_instance= enemy_scene.instantiate()
enemy_instance.global_position = random_spawn_position.global_position
add_child(enemy_instance)
to have it spawn in different random location, but when I run the game, the enemy just disappeared and don't show up at all.
Did anyone encounter the same problem? Any ideas on why this might have happened or how to fix it?
Thank you :)