I have this issue where I need a enemy to be spawn after the player walks into a area they are not suppose to twice but it does not seem to work idk the issue it may be super simple
var farm = preload("res://scenes/farmer.tscn")
var num : int=0
func spawn(pos):
var instance = farm.instantiate()
instance.position = pos
add_child(instance)
func spawn_num():
num+=1
if num>2:
spawn(Vector2(0,0))
is spawn_num hooked up to an area2D entered signal or something?
might be worth checking if the function is actually getting called, it definitely happened to me before that my collision layers were messed up without noticing
I now know some more of what’s happening
1.I can’t spawn in other methods other then ready and process
2.num does update in process but does in spawn_num it just says 0 ever