My enemy spawner isn't working, how do I fix this error?

hi! I’m trying to make an enemy spawner by following a tutorial. But even after following it word for word, at least I think i did, it’s giving me this error, do you know how to fix it?

Your line 3 you wrote "/root/level1", but the level node is capitalized it could only find "/root/Level1".

But! the same error line 19 you wrote level.get_child which is for retrieving a child, not adding one, you probably meant level.add_child

But! (again!) if you want to add the enemy next to the enemy spawner you can use add_sibling(enemy) instead of level.add_child(enemy), so you can remove the var level line in general.

1 Like

it worked, but now they are all coming from only one of the markers. T0T

It’s actually not coming from any marker. The position is never set, seems like you’ve removed that line, previously it was

enemy.position = spawn.position

# though you probably should use global position
enemy.position = spawn.global_position

Oh yeah, you’re right, thanks for pointing that out!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.