Godot Version
4.5.1
Question
Hiya, complete beginner here, but this enemy spawn code seems to do absolutely nothing? the print line in the spawner prints once so its running, but the enemy node doesnt appear in my tree or in my game… im at a loss for what could be doing this!!
func spawn_enemies():
tile = availabletiles.pick_random()
print(tile)
if randf()< enemy_chance:
enemytiles.append(tile)
availabletiles.erase(tile)
return enemytiles
func spawner(object_scene: PackedScene, tiles: Array):
for tile in tiles:
var object = object_scene.instantiate()
add_child(object)
print('enemy placed'+str(tile))
object.global_position=tile