Why won't this enemy spawner even work at all?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Noddy
extends Spatial

onready var Fly = preload("res://Scenes/Enemies/fly.tscn")

func _ready():
	$Timer.start()

func _on_Timer_timeout():
	var fly = Fly.instance()
	add_child(fly)

I absolutely cannot figure out why this won’t work. There is no reason I can see for it not to work.

EDIT:
Alright I’ve redone the spawner entirely and now it spawns the fly, but now the fly’s script doesn’t run. Now there is just an annoying completely frozen fly.

Do you get any error messages or does just nothing happen?

Jowan-Spooner | 2019-05-14 18:17

Did you connect the Timer’s timeout signal? Note: you can set the timer to “Autostart” and you wouldn’t have to start it in _ready()

kidscancode | 2019-05-14 22:04

Nothing happened, no crash, no error message. The game ran as expected minus enemies spawning.

EDIT:
Alright I’ve redone the spawner entirely and now it spawns the fly, but now the fly’s script doesn’t run. Now there is just an annoying completely frozen fly.

Noddy | 2019-05-15 15:55

:bust_in_silhouette: Reply From: Jowan-Spooner

Tried to answer your question here. Writing this to remove the question from unanswered.