Spawn location outrunning spawn Path

Godot Version

4.2.1

Question

I am making an advancing line that spawns mobs along a path and are held back by a collision shape creating a wall of mobs. This scene advances along the -y access but for some reason the mobs spawn location out runs the path it’s supposed to be spawning from.

The code:

Here you can see them spawning past the lines and where the path is
(path is the green dotted line nearest player, other green line is the barrier)

just wondering what I’m doing wrong.

It looks like your enemies are colliding with each other? If that’s the case, and you spawn multiple of them in the same(ish) location, they’ll get pushed off, away from the path. That’s the only explanation I can think of, your code looks sensible.

1 Like

oh yeah, no, I definitely have that problem as well, all the mobs kinda jumble around when a new one spawns inside them, and as the spawn location gets closer to the line some get pushed out, but then you can clearly see the spawn location pass through the line and the character can follow it while leaving the rest behind.

I actually worked on it after making this post(first post so had to be reviewed) and what "fixed it for me was changing add_child to get_parent().add_child. still don’t quite understand why that works or why it outran … itself… as when i ran the program you could clearly see where they were spawning from and it wasn’t following the spawnpath position.

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