Godot Version
v4.3.stable
The sitiation
I was making a space invaders game but I can’t make the player shoot laser
Player script
extends CharacterBody2D
const SPEED = 110
var laser = preload("res://Scenes/laser.tscn")
func shoot():
laser.instantiate()
func _physics_process(delta):
var direction = Input.get_vector("move_left", "move_right", "move_up", "move_down")
position += direction * SPEED * delta
if Input.is_action_pressed("Shot"):
shoot()
move_and_slide()
Laser script
extends Area2D
const SPEED = 130
func _physics_process(delta):
position.y += -SPEED * delta
I can’t figuer it out alone. If someone can healp I be thankful.