UE5 Pause Menus: Stop the Game and Resume with the Same Key

Created: 2026-07-20Last updated: 2026-09-06

Build a pause menu in UE5 that opens and closes with the P key. Organizes Set Game Paused, input routing, and cursor differences, and illustrates two buttons plus the cleanup that lets it open a second time.

Stop the game mid-jump and the character freezes in the air. Even so, the "Resume" button in front of you is clickable. A pause menu needs to stop the game world while still accepting menu input .

Using Set Game Paused alone does not switch input routing or the cursor. This article sorts out what each of those does and builds a menu that opens with P and resumes from either that key or a button.

A pause where the jumping character freezes and the resume button in front stays usable

What You'll Learn

  • That stopping the game and operating the menu are separate
  • The relationship between Set Game Paused and where input arrives
  • How to write opening and closing as a matched pair
  • Handling things that keep moving even when paused

What We Build Here

  • P stops the game and a menu appears in the center of the screen
  • "Resume" returns to where you stopped, "Restart" replays the same level
  • Movement and camera work after closing, and it reopens any number of times

The target is a single-player game on keyboard and mouse using UE5's Third Person template. It assumes you have made Blueprint variables and functions and understand Widget creation and button handling from the UMG introduction.

Sponsored

Stopping the game and operating the menu are separate

Turning on Set Game Paused 's Paused pauses, and off resumes. Return Value is a Boolean saying whether pausing or resuming succeeded.

While paused, normal Actor Ticks, game Timers, and physics simulation stop advancing. Tick is the per-frame update of movement and the like. A Timer is a reservation such as "run this after one second". Stopping mid-jump halts the fall, and resuming continues the calculation from there.

Meanwhile, a UMG button layered on the screen stays usable. Being displayed and being able to receive clicks are separate, though. When opening the menu, line up these three.

What changesSetting usedIts role here
Game progressionSet Game PausedStops the character and physics
Where input goesSet Input Mode Game And UIGives the menu priority for input
Pointer displayShow Mouse CursorMakes the click target visible

For "the menu is visible but I cannot click it", check input routing and the cursor rather than only whether the pause succeeded. Thinking of these three separately saves you from changing settings at random.

The three things to line up when opening a pause: game progression, input routing, and pointer display

Where does input arrive?

Input Mode decides whether keyboard and mouse input goes to the game or the UI. You switch it by specifying the Player Controller that handles the player's input.

ModeHow input is handledUse here
Game OnlyThe game receives itNormal play
UI OnlyThe UI receives itNot used here
Game And UIThe UI receives first, and unhandled input passes to the gameWhile the pause menu is open

Game And UI is not a setting that always sends one action to both. A button click is handled by the UI, for example, and the P key the UI does not use reaches the Player Controller. We close the menu with that P key. Adding your own key handling on the UI side assumes P is not marked as handled there. Official input mode documentation

Comparing Game Only, UI Only, and Game And UI, which passes input the UI did not use to the game

Receiving the close key while paused too

Even with Game And UI, an Enhanced Input action needs a setting to work while paused. Turn on Trigger When Paused for the pause Input Action only.

An Input Action is an asset carrying an action's name such as "Jump" or "Pause". Its key mapping is registered in a separate Input Mapping Context (IMC) . Here we add one mapping: "P key → Pause".

You can also build a close-with-key approach on the Widget side under UI Only. The wiring differs from this article's approach of opening and closing with a Player Controller Input Action, though. Get everything working with Game And UI first.

Hands-On 1: prepare the P key for pausing

1. Create a practice level and Controller

Save the Third Person template level as L_PausePractice with "Save Current Level As". We reopen this level later from the "Restart" button. We use P because Esc ends play in editor Play.

  1. Check "GameMode Override" in "World Settings". If it is None, check Default GameMode under "Project Settings → Maps & Modes".
  2. Duplicate the Blueprint of the GameMode currently in use in the Content Browser and name it BP_PausePracticeGameMode . Carry over the original settings such as Default Pawn Class.
  3. Check Player Controller Class in the original GameMode's "Class Defaults". If that class is a Blueprint, right-click the asset, choose "Create Child Blueprint Class", and name it BP_PausePracticeController . If it is the standard PlayerController, create a new Blueprint with PlayerController as the parent.
  4. Change BP_PausePracticeGameMode's Player Controller Class to BP_PausePracticeController.
  5. Set BP_PausePracticeGameMode in L_PausePractice's GameMode Override and save.

A child Blueprint inherits the original class's logic and lets you add to it. Even when the template has input setup, this keeps it and adds pause handling on top.

Play and confirm movement, jumping, and camera still work as before. If something broke here, do not move on; revisit the original GameMode and Controller settings.

2. Add pause-only input

Create these two from "Input" in the Content Browser.

Assigning the pause Input Action to the P key and receiving it once on Started
AssetSettings
Input Action IA_PausePracticeValue Type=Digital (bool), Trigger When Paused=on, Triggers and Modifiers empty
Input Mapping Context IMC_PausePracticeAdd IA_PausePractice to Mappings with the key set to P. Triggers and Modifiers empty here too

Open BP_PausePracticeController's event graph. If the parent is a Blueprint, run the parent's BeginPlay first in Event BeginPlay, then add Add Mapping Context after it. If there is no parent call, right-click Event BeginPlay and add "Add Call to Parent Function". If you created it fresh with the standard PlayerController as parent, go straight from Event BeginPlay into Add Mapping Context.

Pass the Enhanced Input Local Player Subsystem obtained from Self into Add Mapping Context's Target. Place Self in the graph and search Get Enhanced Input Local Player Subsystem from its blue output. This manages that player's input mapping table. Specify IMC_PausePractice for Mapping Context and 10 for Priority.

BP_PausePracticeController: event graph
Event BeginPlay
  → Parent: BeginPlay
  → Add Mapping Context
      Target: Enhanced Input Local Player Subsystem obtained from Self
      Mapping Context: IMC_PausePractice
      Priority: 10
Getting the player's Subsystem from Self and passing IMC_PausePractice and Priority 10 into Add Mapping Context

Keep the original movement IMC. We do not use Clear All Mappings . The pause mapping stays registered throughout play and is not removed on close.

Next, search for the IA_PausePractice event in the same graph, connect Print String from Started , and set In String to Pause key . With these settings, Started runs once the moment you press. Triggered, which repeats while held, is not what we use for toggling.

Play, click the screen, and text appearing once per P press means input is ready. We replace this Print String with the menu toggle later.

Sponsored

Hands-On 2: line up two buttons

Create WBP_PausePracticeMenu with User Widget as the parent and build this hierarchy in the Designer. If there is no Canvas Panel, add one as the root first.

Canvas Panel
└─ Size Box
   └─ Vertical Box
      ├─ Text "PAUSED"
      ├─ Button "ResumeButton"
      │  └─ Text "Resume"
      └─ Button "RestartButton"
         └─ Text "Restart"
TargetSettings
Size Box's Canvas slotAnchors=center, Alignment=0.5 / 0.5 , Position=0 / 0 , Auto Size=on
Size BoxWidth Override=on at 360 . Height Override off
The PAUSED TextFont Size=32 , Color and Opacity=navy, Justification=center, bottom Padding in the Vertical Box slot=16
Both ButtonsIs Variable=on, Is Enabled=on, Is Focusable=on. Vertical Box slot horizontal Fill, vertical Padding=6
Text inside the buttonsFont Size=24 , Color and Opacity=navy. Horizontal and vertical Alignment in the Button slot=center, Padding=12
Button StyleNormal Tint=light grey, Hovered Tint=blue. Use colors that make hovering obvious
The Canvas Panel, Size Box, Vertical Box, and two-button hierarchy, plus the 360-wide menu centered on screen

Anchors are the placement reference within the screen; Alignment is which part of the Widget lines up with that reference. Centering both puts the menu's center at the screen's center regardless of screen size.

Compile and save. Only the menu's appearance exists so far, so Play shows nothing yet.

Hands-On 3: write opening and closing as a pair

Create a variable PauseMenuWidget in BP_PausePracticeController. Its type is WBP_PausePracticeMenu Object Reference with a default of None.

A reference lets you point at the Widget you created afterwards. Here we store "the menu on screen" in this variable. None means no menu is specified yet. The convention that closing returns it to None is how we judge open versus closed.

Create three functions with no arguments from the "+" on "My Blueprint → Functions", named OpenPausePractice , ResumePausePractice , and RestartPausePractice . Compile once, then build their contents in order.

1. Create the menu and make it usable

Place Create Widget in OpenPausePractice's function graph. Class is WBP_PausePracticeMenu and Owning Player takes Self. Self in this graph is the Player Controller currently in use.

Connect Create Widget's Return Value into Set PauseMenuWidget 's value. The white exec goes from Create Widget to the Set. After that, connect in this order.

OrderNodeInputs and settings
1Add to ViewportTarget=PauseMenuWidget, ZOrder=100
2Set Input Mode Game And UIPlayer Controller=Self, In Widget to Focus=ResumeButton inside PauseMenuWidget, Mouse Lock=Do Not Lock, Hide Cursor During Capture=off, Flush Input=off
3Set Show Mouse CursorTarget=Self, value=on
4Set Game PausedPaused=on
Saving the menu created by Create Widget into PauseMenuWidget and passing it into Add to Viewport's Target

ZOrder is the front-to-back relationship of overlapping Widgets. Higher values come forward. Here the menu goes in front and the game stops last.

Focus is the state where something is selected for keyboard operation. We specify the "Resume" button we want operated first rather than the whole menu. Search Get ResumeButton from Get PauseMenuWidget's blue output and connect its output to In Widget to Focus. Making the Buttons variables is exactly so you can specify them from the graph like this.

Getting the ResumeButton inside the menu from the menu's reference

Pass the retrieved button as the initial selection.

Passing Self into Player Controller and ResumeButton into In Widget to Focus

The second Get ResumeButton continues from the same node made in the first image. You do not need another one. Wire the white exec after Add to Viewport.

OpenPausePractice
  → Create Widget (Class: WBP_PausePracticeMenu, Owning Player: Self)
  → Set PauseMenuWidget (value: Create Widget's Return Value)
  → Add to Viewport (Target: PauseMenuWidget)
  → Set Input Mode Game And UI (Player Controller: Self)
  → Set Show Mouse Cursor (Target: Self, on)
  → Set Game Paused (Paused: on)

Set Show Mouse Cursor is a node setting the Controller's Show Mouse Cursor variable. Search for "Show Mouse Cursor" or search from Self's blue output. Changing the input mode alone does not switch this display setting.

2. Resume the game and clean up the menu

Place nodes in ResumePausePractice in this order. This function is called while the menu is open.

OrderNodeInputs and settings
1Set Game PausedPaused=off
2Remove from ParentTarget=PauseMenuWidget
3Set PauseMenuWidgetvalue=None
4Set Input Mode Game OnlyPlayer Controller=Self, Flush Input=on
5Set Show Mouse CursorTarget=Self, value=off
Passing the menu into Remove from Parent's Target, then returning PauseMenuWidget to None

To put None in, place a new Set PauseMenuWidget and leave nothing connected to its value pin. The default None goes in.

Taking it off screen and emptying the reference are separate. With only Remove from Parent, the variable still remembers that Widget. Since we later check "is there a menu", return the reference to None so closing is detectable.

Flush Input clears the input state up to that point. After resuming, press the movement keys again to confirm.

Turning on the cursor and pause at the end of opening, and returning to Game Only with the cursor hidden at the end of closing

The top row of the diagram is the end of OpenPausePractice and the bottom is the end of ResumePausePractice. Wire them as continuations of their separate functions.

3. "Restart" resumes first, then reopens the level

In RestartPausePractice, call Resume Pause Practice first and connect its exec output into Open Level (by Name) . Level Name is L_PausePractice , Absolute is on, and Options is empty.

RestartPausePractice
  → Resume Pause Practice (Target: Self)
  → Open Level (by Name) (Level Name: L_PausePractice)

"Resume" continues play from the current position. "Restart" reloads the level, so the character returns to the start position too. Routing both through the same ResumePausePractice prevents forgetting to restore input and the cursor.

You can type the level name here because we saved with that name at the start of the exercise. Building this into your own level means matching Level Name to your saved asset name.

Hands-On 4: connect the key and the buttons

Let P choose between opening and closing

Return to BP_PausePracticeController's event graph. Remove the earlier Print String and connect IA_PausePractice's Started into a Branch .

From Get PauseMenuWidget, create the Is Valid without a white exec pin and pass its Boolean output into Branch's Condition. Is Valid checks whether a reference is usable.

  • True: call Resume Pause Practice (Target=Self)
  • False: call Open Pause Practice (Target=Self)
Going from Started into a Branch that resumes when the menu reference is valid and opens when it is not

By our convention, a reference means it is open so we close it, and None means we open a new one. Rather than removing the menu from elsewhere or overwriting PauseMenuWidget, keep opening and closing in these two functions.

Compile and Play. P showing the menu and stopping the game, then releasing P and pressing again to close it, means key toggling works.

Sponsored

Call the Controller's logic from the buttons

Select ResumeButton in WBP_PausePracticeMenu's Designer and add On Clicked from Events in the Details panel. Add the same event for RestartButton.

Connect a white line from each event into Cast To BP_PausePracticeController . Pass Get Owning Player 's Return Value, placed inside the Widget, into the Cast's Object.

Get Owning Player retrieves the Controller passed into Create Widget's Owning Player. The Cast treats it as the class we made so we can call its dedicated resume function.

Button eventFunction called from the Cast's success execThe function's Target
ResumeButton's On ClickedResume Pause PracticeThe Cast's As BP Pause Practice Controller
RestartButton's On ClickedRestart Pause PracticeThe Cast's As BP Pause Practice Controller

Connect Print String to Cast Failed and have it output Pause controller mismatch . If that text appears, check the practice level's GameMode and Player Controller Class and Create Widget's Owning Player.

Casting Owning Player from the resume button's On Clicked, calling the Controller's resume function on success and Print String on failure

The diagram shows ResumeButton's wiring. RestartButton is the same shape with the final call changed to Restart Pause Practice.

There is no need to build Set Game Paused and cursor settings again on the Widget side. Buttons just ask the Controller to "resume" or "restart".

Run it and confirm

Compile and save both Blueprints, then Play. Click the game screen to start controlling.

ActionExpected result
Walk, then press P mid-jumpThe character stops in the air and the menu and cursor appear
Hover over "Resume"The game stays stopped while the button's color changes
Press "Resume"The menu disappears and the fall continues from where it stopped
Try movement and mouse camera controlControls work normally and the menu cursor does not linger
Press and release P, then press P againIt toggles with the key alone
Move a little, press P, and press "Restart"The level reopens and you can play from the start position
Toggle with P againIt opens and closes without stacking on later attempts

The point is not stopping at "I saw it" but confirming the controls after resuming and the next toggle .

Pressing P mid-jump freezes you in the air, resuming continues the fall, and reopening does not stack

When it does not work

SymptomWhere to check
No response from the first PIMC_PausePractice registration, GameMode Override, the Controller's parent BeginPlay, whether input reaches the game screen
Holding toggles it repeatedlyWhether you use IA_PausePractice's Started, whether extra conditions were added to Triggers
P opens but does not closeWhether Trigger When Paused is on, whether it is Game And UI, whether the UI already handles P
Cannot click the buttonsInput Mode, Show Mouse Cursor, the Button's Is Enabled
Buttons respond but do not closeThe Cast Failed Print. The success exec line and the function's Target connection
Cannot open a second timeWhether ResumePausePractice returns PauseMenuWidget to None
Cannot control after resumingWhether you returned to Game Only, whether you pressed the movement keys again
"Restart" does not reloadWhether L_PausePractice was saved, whether Open Level's Level Name matches

To isolate the pause itself, output Set Game Paused's Return Value or Is Game Paused to Print String. It separates "the key is not arriving" from "pausing failed".

Bonus: when you want to choose what stops

Audio does not necessarily stop the same way. Whether it plays while paused depends on settings such as the Audio Component's Is UI Sound. Rather than assuming "all audio stops" or "audio is exempt", check BGM, sound effects, and menu sounds individually. To stop a specific Audio Component explicitly, use Set Paused . Official Audio Component settings

When you want an Actor to Tick while paused. Tick Even when Paused under Class Defaults' Actor Tick allows it. Calling Tick and advancing in-game time are separate, though. This alone does not make physics or all of that Actor's Components run as usual. You do not need to turn it on for the whole character just for this menu.

Extending to a title or settings screen. A "return to title" button cleans up like our restart does, then opens the saved title level. The Open Level article continues from there. Switching to a settings Widget also means handing focus to the first button, not just displaying it.

Online menus are a separate design. This article is single-player. Opening your own menu mid-match should switch your controls and UI rather than stopping other players' games.

Summary

A pause menu switches game progression, input routing, and the cursor, and restores them on close. Here we received the pause Input Action without stopping it and called the same resume logic from the P key and a button.

Start by stopping mid-jump and feeling the fall continue when you press the button. Reaching that point means you built the two behaviors of "the game is stopped yet the menu is usable" yourself.

Reference: Set Game Paused, Enhanced Input, Input Action pause settings, Actor Ticking

Unreal Engine Notes in this section98