GodotWIP/src/components/Hitbox_Component.gd

9 lines
335 B
GDScript

extends Area2D
func set_hitbox(enabled: bool):
for child in get_children():
if child is CollisionShape2D:
child.set_deferred("disabled", !enabled)
## TODO: This breaks now I guess because I moved the process functions out to parent class
#player_hurtbox.set_deferred("disabled", !enabled) #WTF Apparently this is how to do it