Any suggestions for how to make a parrying mechanic

Godot Version

4.2.1

Question

Hi all, so I’m making a 2d project that I want to have a parrying mechanic that would have the same feel as games like Sekiro: Shadows Die Twice or 9 Sols.

as of this post I’ve made a few enemies and I’ve begun refining my player character and I think I’m knowledgable enough in godot to make a parrying mechanic.

my initial thoughts for something simple that can be applied to basic enemies:

The parry should be a timer that triggers a variable when it starts and ends.
if said variable returns true and the player character is hit.

The player should not transition to hurt state but stay in the parry state and negate any damage taken and trigger an attack failed (recoil / punish / stun) to the enemy that should momentarily stop the enemy from transitioning to any other state. (this can be done by checking if the parry var returns true when the enemy attempts to deal damage)
So as to give the player a window of opportunity

and then probably also a parry cooldown timer to prevent invincibility from spamming parry

What it should look like:

  1. Player presses parry the moment before getting hit
  2. Parry timer and parry cooldown timer are started and var returns true while parry timer is active
  3. The enemy gets parried and is stunned momentarily

Am I missing anything important?

any and all suggestions, former experience with something like this and comments are appreciated :slight_smile:

You might want to switch the player to a “successful parry” animation.

You might also want to consider what happens if the player is being attacked by two (or more) enemies at once, and successfully parries an attack. Do they remain in parry mode and all attacks bounce off? Do they become briefly invincible so other attacks miss but don’t stun the attackers?

Some games do parrying with its own hitbox, to allow for things like blocking with a weapon.

1 Like

In Sekiro I’m not sure the parry is actually tied to the hitbox of the attack. For example, you can evade some attacks by jumping, but it doesn’t really matter when you jump exactly, as long as you jump around the right time.

I think Sekiro works more along the lines of attack having a parry window, and if the player pushes parry when inside that window, then something happens. This is probably different from your design, where attacks would have to hit in order for the parry to take effect. I don’t think in Sekiro the attacks actually have to connect in order to parry.

I think the best, if you want to replicate a mechanic from a game, is to play the game with thought and try to see what’s actually happening.

1 Like