I have the player and the projectile, I know how to do this in 3D but not in 2D, tried to monkey around but nothing really came out of it except bad code.
if Input.is_action_pressed("gun") && canfire:
$Laser.play()
$Cooldown.start(0.3)
var instance = projectile.instantiate()
instance.global_position = global_position
instance.transform = global_transform
canfire = false
The projectiles are removed after 5 seconds of existence, which is enough for most people. I appreciate the help!