Shooting Point

I figured I would show an example of another way this could be designed for anyone else thats interested in a different way to handle shooting from the player character :slight_smile:

Create a Node2D under your player and call it ShootPoint.
image

Position the ShootPoint wherever you would like to shoot projectiles from.
image

When choosing to shoot a projectile u can just choose to instantiate the rocket or any other projectile you add to your game at the players ShootPoint’s current position.

Creating the Shootpoint variable and setting it with @oneready (This can also be manually set with the @export, but i always try and handle everything through code if possible) as well as defining what type of variable this is.
image

Instantiating the rocket at ShootPoint position
image

Hope this helps and good luck making a game!

6 Likes

nice one, cheers for sharing a fab idea.

and if there were other weapons, you could use multiple say position2D nodes and instantiate a bullet on each one at the same time :slight_smile:

3 Likes

Yeah, no problem! Hope the idea was useful for others!

1 Like

fyi, it looks like Position2D is now called Marker2D

3 Likes

Privacy & Terms