Gamemaker: Making a bullet Spawn at the enemy it was called from
- by Strokes
I'm making a gamemaker game with gml. In this game I have multiple enemies (same object) on screen at the same time. I want them to all spawn a bullet at their location. But instead each enemy spawns a bullet at one single enemy. They all shoot but the bullets appear in the wrong location. I want the bullet to spawn at the location of the instance is was called for. How do I do this?
Thank you for reading my question.
Code:
obj_carrier is the enemy I want to spawn from.
obj_carrier_bullet is the bullet I want to spawn at location of the carrier
There are multiple carriers around the stage.
In the step event of the carrier following an if statement:
instance_create(obj_carrier.x, obj_carrier.y, obj_carrier_bullet)