17 lines
332 B
GDScript3
Raw Normal View History

2024-02-12 23:22:27 +00:00
class_name SkillsComponent
extends Node
var player: Player
2024-02-13 10:17:45 +00:00
var area: Area3D
2024-02-12 23:22:27 +00:00
func _ready():
player = owner
2024-02-13 10:17:45 +00:00
area = %MeleeArea
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 20:04:35 +00:00
func use_skill(_slot: int):
2024-02-13 10:56:04 +00:00
await get_tree().create_timer(0.7).timeout
2024-02-13 09:38:26 +00:00
area.monitoring = true
await get_tree().create_timer(0.1).timeout
area.monitoring = false