16 lines
249 B
GDScript3
Raw Normal View History

2024-02-12 23:22:27 +00:00
class_name SkillsComponent
extends Node
var player: Player
func _ready():
player = owner
2024-02-13 20:04:35 +00:00
player.skill_used.connect(use_skill)
2024-02-12 23:22:27 +00:00
2024-02-13 22:12:32 +00:00
func use_skill(skill: Skill):
if !skill:
return
var scene := skill.scene.instantiate()
player.add_child(scene)