Why can you roll through an attack? Invincibility frames and dodge timing explained
Ever rolled straight through a boss's sword and taken no damage? That's not physics: for a few frames the game simply stops checking whether you got hit. These are invincibility frames, or i-frames.
Learn what a frame is, why pressing dodge isn't the same as being safe, and why longer i-frames make timing more forgiving. Then slide a dodge across an attack timeline and find the exact moment it works.

Why you can roll through an attack
You press the dodge button, your character tumbles straight through a giant swinging sword, and nothing happens. The sword is right there. The character is right there. Why didn't it hurt?
The answer is a rule, not physics. For a few moments the game simply stops checking whether you got hit. Those moments are called invincibility frames, or i-frames. Once you know they exist, dodging stops feeling like luck and starts feeling like timing.
What a frame is, and why it matters here
A game redraws and updates itself many times a second. Each update is one frame. At 60 frames per second, one frame lasts about 16.7 milliseconds, so 10 frames is about a sixth of a second. Games run their rules once per frame: move the character, move the enemy, check whether anything touches anything else.
That "does anything touch you" check is the damage check. An enemy attack has a damaging part (often called its active frames), and during those frames the game asks: does this attack overlap the player? If yes, you take damage. A dodge roll adds one extra line to that question: and is the player currently vulnerable? During i-frames the answer is no, so the overlap is ignored. The animation still shows you inside the attack. The game just doesn't care.
Try it: line up the roll with the hit
Below, the top row is an enemy attack. It winds up, then hits for 6 frames, then recovers. The bottom row is your dodge: a short startup, then your i-frames, then a recovery where you can't do much. Slide the dodge to the right moment and make the hit miss.
Three things to notice
First, pressing the button is not the same as being safe. Your i-frames don't start the instant you press. There is a tiny startup before they switch on, so you have to press a little before the attack lands. This is why dodging "into" an attack works better than dodging after it has already started to connect.
Second, longer i-frames mean more slack. Drag the length slider up and watch the window of presses that work grow. A long window forgives sloppy timing. A short one demands that you read the attack precisely. That is one of the main ways designers tune how hard a fight feels.
Third, the roll has a price. Once your i-frames end, you are still in the recovery part of the roll and can't attack or block. If you roll too early, you come out of it just as the hit arrives, vulnerable and stuck. Many games add a stamina cost on top, so you can't simply roll forever.
Other kinds of invincibility
A dodge roll is the one you control, but it isn't the only kind. Some games give you a short protected window right after you take damage, often shown by your character flashing, so one big enemy can't hit you ten times in a row. Others make you briefly untouchable when you respawn, or during certain special moves and animations. They all use the same idea: a flag that says "ignore damage for now."
Don't confuse i-frames with armor in the sense some action games use it. That kind lets you keep attacking while being hit and only stops you from being knocked back or interrupted. You still take the damage. It is a different rule with a different job.
What this means when you play
If a boss keeps hitting you mid-roll, the likely cause is timing, not the game being unfair. A few habits help in most action games that use dodge rolls:
Watch the attack's wind-up and press the dodge as it finishes, not when you see the weapon already close to you. Roll toward or through the enemy when you can, because the roll's i-frames protect you either way and it often puts you behind them. And learn one enemy at a time: the same roll can be perfect against a slow overhead swing and useless against a quick multi-hit combo, because the hits are spread over a longer period than your window.
Exact i-frame counts differ from game to game, and some games let your gear or settings change them, so it's worth checking the game's community wiki before trusting a number you've heard. The general lesson holds everywhere: a dodge is a short, timed rule, and the better you read the tell, the more of those frames work for you.
More in Game Mechanics
all Game Mechanics →2 Nov Why can't you attack right away? Startup, recovery and frame data explained Why can't you attack the moment you press a button? Fighting games count every move in frames: startup before it hits, active frames where… Game Mechanics
31 Oct Why do abilities have cooldowns? Cooldowns, mana and stamina explained Why can't you spam your best move? Games limit abilities with cooldowns, mana or stamina, and each one gives a fight a different feel. Try… Game Mechanics
29 Oct Why do levels get slower? XP curves and level pacing explained Why do levels get slower the higher you go? Because the game charges more XP for each level, and that price list is called an XP curve… Game Mechanics
27 Oct What are weapon spread and recoil? Why your shots miss when you aimed right Why do bullets miss when your crosshair was right on target? Two different things are at work: spread, a random cone around your aim, and… Game Mechanics
25 Oct What is time to kill (TTK)? Why some shooters feel fast and others forgiving Why do some shooters feel lightning fast while others let you fight back? The answer is time to kill (TTK): how long a weapon needs to take… Game Mechanics
23 Oct Why does armor stop helping? Flat, percentage and diminishing returns explained Why does armor stop helping? Flat, percentage and diminishing returns are three different rules for turning an armor number into less…