(FIXED) Make bullet shoot from Player position

What I’m trying to do is make the dark blue bullet shoot from the grey rectangle’s (the player) position.

The problem is that when I press the button to shoot, the bullets are created at a specific position on the scene, not from the player’s position.

I’ve tried three different tutorials and none of them has worked for me.

Also, I have the FireBullet behaviour applied to the grey rectangle.

May I ask in which layer are you creating the bullet?

If you are creating it on a different layer, lets say the base layer, then the position must be calculated based on the difference between the base layer camera, and the player camera…

Or maybe create the bullet in a layer where you have the camera already centered which is clearer and easier.

1 Like

Hello, Oscuridad!

The layer the bullet is on is the layer named Player. The grey rectangle that represents the player is also on the Player layer. So far, all layers have the Center Camera command.

I tried making the bullets appear on the other layers to experiment but it didn’t fix the problem. D :

Found the issue!

Some of the code was misspelled. That’s why it wasn’t shooting right! This is how it should be spelled.

Thanks for the help, Oscuridad. Talking with someone always helps with my GD problems.

1 Like