Opportunity Attacks in 5e, Explained on a Grid
An opportunity attack happens when an enemy leaves your reach. Here's what provokes one, what doesn't, and how to avoid it, shown square by square.

An opportunity attack in 5e happens when a hostile creature you can see moves out of your reach. You spend your reaction to make one melee attack against it, and the attack lands right before it leaves. If the creature takes the Disengage action first, or gets moved without using its own movement, action, or reaction, it doesn’t provoke.
TL;DR:
- Provokes: leaving an enemy’s reach using your own movement.
- Doesn’t provoke: moving around inside an enemy’s reach, taking the Disengage action first, or being shoved or pushed away by someone else.
- Costs: your reaction. You get one per round, and it comes back at the start of your turn.
- What you get: one melee attack. No ranged attacks.
Building the rules engine for Artifice meant writing this rule down square by square, including the edge cases people argue about at the table. This guide gives you the rule, a quick table, and five worked examples for your next session.
Everything here follows the D&D 5e (2014) rules, as written in the free System Reference Document 5.1.
What is an opportunity attack in 5e?
An opportunity attack is a free swing at an enemy that tries to walk away from you. It’s how 5e makes the front line matter: if you’re standing next to an orc, it can’t just stroll past you to reach the Rogue in the back.
Here’s the rule in plain words:
- The trigger: a hostile creature that you can see moves out of your reach.
- The cost: your reaction.
- The attack: one melee attack against that creature.
- The timing: it happens right before the creature leaves your reach, so it’s still next to you when you swing.
What provokes an opportunity attack (and what doesn’t)
Only one thing provokes: leaving someone’s reach by your own movement. Use this table at the table.
| Provokes an opportunity attack | Doesn’t provoke |
|---|---|
| Moving out of an enemy’s reach on your own movement | Moving around while staying inside an enemy’s reach |
| Using the Dash action and running out of reach | Taking the Disengage action before you move |
| Walking away from a reach weapon’s 10 ft zone | Being shoved or pushed out of reach by someone else |
| Being moved without using your movement, action, or reaction | |
| Leaving the reach of a creature that can’t see you | |
| Standing up from prone |
Note what’s not on the left: moving toward an enemy, moving past it while staying close, and attacking it. None of those provoke.
Reach decides everything
Normal reach is 5 feet. On a 5 ft grid, that means the eight squares touching yours, diagonals included. A creature provokes when it leaves that ring of squares.
Some weapons have the reach property: the glaive, halberd, lance, pike, and whip. They add 5 feet to your reach, both when you attack with them and when you make opportunity attacks with them. That gives you 10 feet, or two squares in every direction.
With 10 ft reach, the line that matters moves outward. A creature can step from 5 feet to 10 feet away from you and still be inside your reach, so no attack. It only provokes when it leaves the 10 ft zone. Scenario 5 below walks through it square by square.
Your reaction: one per round
You get one reaction per round. When you use it, you can’t take another reaction until the start of your next turn.
That’s the real limit on opportunity attacks. Say two goblins are next to your Fighter, and both run off on their turns. Your Fighter swings at the first goblin with its reaction. The second goblin leaves for free, because the reaction is already spent.
Smart DMs use this: the first enemy to leave draws the attack, and the rest follow.
How to avoid opportunity attacks
You have four honest options: take the Disengage action, move only inside the enemy’s reach, have an ally shove the enemy away, or never get close in the first place.
Take the Disengage action
Disengage is an action. For the rest of your turn, your movement doesn’t provoke opportunity attacks. The catch is that it usually costs the action you’d have used to attack.
Here’s what that looks like in Artifice. The Rogue has taken the Disengage action, so its action is spent, and the path leaves the orc’s reach with no warning.

Some characters get it cheaper:
- Rogue: from level 2, Cunning Action lets you Dash, Disengage, or Hide as a bonus action. A Rogue can attack, then Disengage, then walk away.
- Monk: from level 2, Step of the Wind lets you spend 1 ki point to Disengage or Dash as a bonus action. Your jump distance doubles for the turn too.
- Goblins: monsters can do it as well. A goblin’s Nimble Escape lets it Disengage or Hide as a bonus action on each of its turns, which is why goblins are so annoying to pin down.
Move inside the reach, then leave on your terms
Moving inside an enemy’s reach is free. You can walk around an orc to its far side, and it gets no attack. You only provoke when you finally step out. So if you have to leave, pick the exit square that sets you up best for your next turn.

Let an ally shove the enemy away
Shoving is a special melee attack. It replaces one attack when you take the Attack action. You make a Strength (Athletics) check against the target’s Strength (Athletics) or Dexterity (Acrobatics). If you win, you push it 5 feet away or knock it prone. The target can be up to one size larger than you.
A pushed creature is moved without using its own movement, action, or reaction, so nobody gets an opportunity attack on it.
Stay out of reach to begin with
The simplest fix is not to end your turn next to an enemy you’ll want to leave. Fighting from range, or letting enemies come to you, avoids the problem.
Opportunity attacks on a grid: 5 scenarios
Each square is 5 feet, and north is up.
1. The Rogue steps away from the orc: provokes
The Rogue starts directly south of the orc and walks two squares south, ending 15 feet away. Its first step takes it out of the orc’s 5 ft reach.
Verdict: provokes. The orc uses its reaction and attacks right before the Rogue leaves the square next to it.

2. The Fighter circles the orc: no attack
The Fighter starts west of the orc and walks around it: northwest corner, north, northeast corner, then east. Every square on that path touches the orc’s square.
Verdict: doesn’t provoke. The Fighter never left the orc’s reach. Moving around an enemy is free.
3. The Rogue Disengages, then runs: no attack
Same start as scenario 1. This time the Rogue attacks the orc, then uses Cunning Action to Disengage as a bonus action, then walks two squares south.
Verdict: doesn’t provoke. Disengage covers the Rogue’s movement for the rest of the turn. The orc keeps its reaction.
4. The Barbarian shoves the bandit away: no attack
The Barbarian is next to a bandit. It takes the Attack action and uses one attack to shove. It wins the contest (if it’s raging, Rage gives it advantage on the Strength check) and pushes the bandit 5 feet north.
Verdict: the bandit doesn’t provoke. It was moved by someone else, not by its own movement. Neither the Barbarian nor anyone else gets an opportunity attack on it.
5. The Fighter has a glaive: the 10 ft line
The Fighter holds a glaive, so its reach is 10 feet. The orc starts directly north of the Fighter, in the next square. It walks north, one square at a time.
- Step 1: from 5 feet away to 10 feet away. Still inside the glaive’s reach. No attack.
- Step 2: from 10 feet away to 15 feet away. That leaves the reach. Provokes.
Verdict: provokes on the second step, not the first. With a reach weapon, you’re watching the 10 ft line, not the 5 ft one.
Using opportunity attacks well
Opportunity attacks are as much about where you stand as when you swing. A few tactics that work at any table:
- Hold a chokepoint. Stand in a doorway or a narrow gap. Any enemy that wants past you has to leave your reach to do it, or stop and fight.
- Make enemies choose. If your Fighter or Barbarian stands next to the strongest enemy, it has to pick: stay and fight the tough one, spend its action on Disengage, or eat an attack to reach your Rogue.
- Turn off their reaction. A Monk on the Way of the Open Hand path gets Open Hand Technique at level 3. When one of your Flurry of Blows attacks hits, one option is that the target can’t take reactions until the end of your next turn. Then you walk away without an opportunity attack.
- Push instead of hit. Another Open Hand Technique option pushes the target up to 15 feet if it fails a Strength saving throw. Like a shove, that movement never provokes.
- Pick your target. With two enemies next to you, don’t spend your one reaction on the weakest if the bigger threat is about to run for your back line.
If you play alone, these choices matter even more, because nobody else covers your back. I cover that in how to play D&D solo.
How Artifice handles opportunity attacks
Opportunity attacks are much easier to judge when something else counts the squares. In Artifice, a built-in deterministic rules engine resolves dice, combat, and character mechanics. It tracks initiative, hit points, movement, attacks, actions, bonus actions, and reactions on a real 5 ft grid (here’s how the maps get drawn). I wrote about why the rules engine rolls the dice instead of the AI.
When you plan a move, the game previews it before you commit. If the move would provoke an opportunity attack, it tells you.

In that screenshot, a character is next to a hooded enemy with a scythe. The preview shows a 15-foot move with 15 feet left, and a label that says “Provokes Opportunity Attack”. The bar at the bottom shows what’s left this turn: action spent, bonus action ready, reaction ready. You can cancel the move and pick another square instead of finding out the hard way.
When an attack does happen, the result is traceable to dice and modifiers, so there’s no arguing about it afterward. For the bigger picture, read how Artifice plays an AI Dungeon Master in 3D.
Artifice is in Early Access, and Artifice is free. Solo today, multiplayer coming later. Playtests are announced in the Discord, and that’s where the sign-up link goes up.
Join the Artifice Discord to try the grid in Early Access
Opportunity attack FAQ
Does Dash provoke an opportunity attack?
Yes, if you leave someone’s reach. Dash gives you extra movement, but it doesn’t protect that movement. To move away safely, you need Disengage.
Can you make an opportunity attack with a ranged weapon?
No. An opportunity attack is a melee attack. If you only have a bow in hand, you can’t use it to make one.
Does standing up from prone provoke an opportunity attack?
No. Standing up costs half your movement, but you don’t leave anyone’s reach by doing it, so nothing triggers.
Do opportunity attacks happen before or after the move?
Before. The attack happens right before the creature leaves your reach, so it’s still next to you when you swing. If the hit drops it to 0 hit points, it never gets away.
Can you make more than one opportunity attack per round?
Not in the base rules. Each opportunity attack uses your reaction, and you get one reaction per round. It comes back at the start of your turn.
Know the line, then stand on it
Opportunity attacks come down to one question: did the creature leave your reach using its own movement? If yes, and you still have your reaction, you get one melee swing. Once your group knows that, the arguments stop, and positioning starts to feel like a real choice.
If you’re picking a character to try these tactics with, a Fighter or Rogue is a good start. Here’s my guide to the best D&D classes for beginners. And if you want a game that tracks every reaction for you, come say hi.
Join the Artifice Discord to try the grid in Early Access
Artifice is an independent game and is not affiliated with Wizards of the Coast. Dungeons & Dragons is a trademark of Wizards of the Coast.