extends StaticBody2D var projectile @onready var ProjectileScene = preload("res://Scenes/Entities/Enemies/Projectile.tscn") func _on_timer_timeout(): if projectile: await projectile.tree_exited projectile = ProjectileScene.instantiate() projectile.tree_exited.connect(func(): projectile = null ) projectile.hit.connect(func(): Global.player.take_damage(1) ) projectile.global_position = $ProjectileStart.global_position projectile.target = Global.player.position projectile.scale = Vector2(0.75, 0.75) projectile.speed = 60 get_tree().current_scene.add_child(projectile)