Godot Version
4.2
Question
I wanted to add a Fireball as a projectile for my Metroidvania style game, I tried a lot of tutorials but nothing seems to work, I press the button to shoot the fireball but nothing happens. Can someone help me?
@onready var Fireball = preload("res://fireball.tscn")
func shoot():
if Input.is_action_just_pressed("shoot"):
var magic = Fireball.instantiate() as Node2D
magic.global_position = muzzle.global_position
get_parent().add_child(magic)