actionrpg-heartbeast/ActionRPG-HeartBeast/Overlap/Hurtbox.gd
2024-11-19 17:04:41 -05:00

23 lines
528 B
GDScript

extends Area2D
export(bool) var show_hit = true
const HitEffect = preload("res://Effects/HitEffect.tscn")
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
func _on_Hurtbox_area_entered(area):
if show_hit:
var effect = HitEffect.instance()
var main = get_tree().current_scene
main.add_child(effect)
effect.global_position = global_position