Question regarding invincibility

I have two concerns regarding invincibility, so I would like to ask for your help.

  1. During knockback, the attack somehow registers as multi-hit.

In my own project, I disable the HitCollision of the knockback animation at the exact moment damage is received, so theoretically, after the first hit, no further hits should register. However, sometimes a single attack hitbox registers multiple hits (resulting in 2–3 instances of damage). I could understand if it were only 2 hits (possibly due to frame delay), but when it registers 3 or more hits, I’d like to know whether this is a bug or intended behavior.

  1. Invincibility settings using nodes other than knockback.

I am trying to create invincibility data (as shown in the image) such that invincibility begins at the moment the character stands up after taking damage. I have set the “stand-up invincibility” switch to ON during the stand-up animation (meaning invincibility should begin here), but for some reason, invincibility does not activate. Instead, the invincibility duration only reappears when the character takes damage again. I would like to debug this by checking the switch status during gameplay, but I cannot find any feature that allows me to monitor switch states during gameplay (I want to confirm whether the “stand-up invincibility” switch is actually functioning correctly).

Sorry if this was unclear. Thank you for your help.

Regarding #1, if the invincibility duration is higher than 0.02 does the multiple hits still register?

#2. AGM had a switch label debugger you can create in the object creation and then copy paste it to your object you want tested and setup the parameters in the inspector. Here is a video of the process that might help:

I apologize for the delayed reply.

Thank you for the information regarding the Switch Label Debugger. I will look into it when I have time and consider implementing it if necessary.

Regarding #1: After setting invincibility time (0.02 seconds), multi-hit occurrences ceased. Since I was removing the hit detection, I judged that making the character invincible was unnecessary. I suspect the cause was that I had not made the character invincible during hits.

Thank you for your continued support.

1 Like

This can be fixed using the new Is Once Per Attack Target setting on the AttackArea2D. You can then set a cooldown time till the next attack can happen. This is better setting then the disable collision method:

Thank you for the information. I would like to implement it right away.

However, according to the information, it seems that the specification is such that “the attack hitbox and the collision hitbox will still make contact,” resulting in a hit判定 even if there is no damage (in this game, we display a hit mark when an attack lands).

I heard that “processing to disable the attack hitbox upon impact” would be required, but I am struggling as I do not know how to actually perform this processing. I am unable to find a way to branch based on the condition of “when our attack lands,” nor can I find an action to “disable the attack hitbox.” If possible, I would appreciate your guidance on this matter.

You can use ChangeObjectProperty and set the disabled property of the AttackCollision node (the child of the AttackArea2D node).