Rockets aren't spawning from player

Hello, my rockets aren’t spawning from the player ship but instead are spawning at the (0, 0) cooridinates and are only at the top of the screen. I am not sure what I did wrong or if I perhaps skipped a step. I went back through the earlier videos but didn’t see where we made any changes about how the rockets spawn.

Here is a screenshot:

I think you just missed a step, not a big deal =)

The rockets are spawning and they are clearly moving as intended; you need to set their initial position to that of the player, plus maybe an offset. This is what I did inside the player script, and I’m pretty sure this is unmodified from the course:

rocket_instance.global_position = global_position
rocket_instance.global_position.x += 50

Thank you that fixed the issue. I was missing the

rocket_instance.global_position = global_position

line of code. Now the rockets spawn correctly. Thank you so much.

1 Like

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

Privacy & Terms