Spawn enemies

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

var enemy = preload("res://Enemy1.tscn")

func _on_Timer_timeout():
	var yLoc = 0
	var xLoc = 0
	var e = enemy.instance()
	e.position = Vector2(xLoc, yLoc)
	$Timer.wait_time = max(.01, $Timer.wait_time - .05)

What have I done wrong? Nothing spawns

have you checked if _on_Timer_timeout() is even called?
Maybe the timer does not start (you should flag autostart on the timer property, or use start() method)

Andrea | 2020-05-27 09:38

Yeah, I ve checked it but nothing…

MightyRat | 2020-05-27 10:30

share the project or a smaller version of it

Andrea | 2020-05-27 10:38

Found the mistake, cordinates are wrong

MightyRat | 2020-05-27 15:12