How to Implement an error free HitBox

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By iron_weasel

In my game the character punches and kicks so I want to implement a hitbox that can turn on and off with animation. Therefore, I created an Area2D (with CollisionShape2D) and set about animating the “monitoring” parameter with an AnimationPlayer. However, it creates this error:

E 0:00:04:0619   Condition ' !area_in && !E ' is true.
  <C Source>     scene/2d/area_2d.cpp:264 @ _area_inout()

Next I tried setting the AnimationPlayer Process to Physics and I added a Function track and used call_deferred(set_monitoring, True), but neither of these steps fixed the bug.

I can think of script that would help make this work (essentially, capturing Area2D enters and exits, but being selective about when to pass them on). But what I would like to know is if there is a way to do this without an additional script? How can I animate the relevant Area2D properties without causing the error?