19 · Combat · 2D and 3D

Invincibility frames

A short safety window after getting hit.

Without a grace period, standing inside an enemy deals damage every single frame and drains a full health bar in a second. A brief window of invincibility after each hit (often shown by blinking) makes damage readable and fair, and gives the player time to escape.

←→ moveSpace or ↑ jumpI i-frames on/off◀ ▶ move, Jump

Try this: Let the slime run into you with i-frames off and watch the health bar. Turn them on (I) and do it again.

Health 10 / 10Hits taken 0

Stand still and let the slime reach you.

Prompt bit

Works for 2D or 3D in any engine (Unity, Unreal, Godot, web). Paste the short one for a quick fix, or the detailed one when you want it done properly.

Give the player invincibility frames: after taking damage, ignore further damage for 0.8 s while the sprite or mesh blinks, still let them collide and move normally, and make sure falling into a pit or other instant-death hazards still kills during the window.

43 words · one sentence to paste as is

Where it's used

Common mistakes

No i-frames at all (contact damage every frame), i-frames that also block pits and kill zones (players stand in lava), no visual signal so players do not know they are safe, and giving enemies long i-frames so combos stop working.

Writing this with an AI assistant? See our best AI coding assistants for game developers.

Missing a concept? Request one.

Related concepts

New concepts, in your inbox.

One short email when we add new concepts, plus our weekly roundup of AI tools for game devs. Unsubscribe any time.