I'm trying to create a destroyable object that requires the player to hold down a button for a specific amount of time to destroy the object.
The object has a health variable, I want to use this to play an animation depending on how much health it has.
The player also has an Area2D which detects the body of the breakable object (StaticBody2D), when it does detect it, it emits the breakable objects signal "hit".
I then want to connect the "hit" signal to a function that decreases the health variable depending on how long that signal is being relayed (or is there another way to do this..?)
How could I achieve this?