So, I used this code:
extends Area2D
export (int) var speed = 750
onready var kill_timer = $KillBulletTimer
var direction := Vector2.ZERO
func ready() -> void:
killtimer.start()
func physicsprocess(delta: float) -> void:
movelocaly(speed * delta)
if direction != Vector2.ZERO:
var velocity = direction * speed
global_position += velocity
func set_direction(direction: Vector2):
self.direction = direction
func onKillBulletTimertimeout():
queuefree()
But my bullets go downwards when I shoot. What should I do?