Overlay Examples
This section provides practical examples of using the Steam Overlay subsystem to interact with Steam’s built-in UI, invite other players, and react to overlay-related events during gameplay.
All examples below are shown using Blueprint nodes, with equivalent functionality available through the C++ API.
Opening the Steam Overlay
This example demonstrates how to open the Steam Overlay to a specific built-in section.
The Activate Overlay node opens the Steam Overlay to the selected section. The available sections are defined by ESteamOverlaySection.
This is typically triggered by user actions like pressing a menu button or selecting a social option inside the game. Steam handles all UI rendering and input while the overlay is active.
Inviting Friends to a Lobby
In this example, the Steam Overlay is used to invite friends to a lobby.
The Open Invite Dialog To Lobby node opens the standard Steam invite dialog for the specified FSteamLobbyID.
Steam automatically handles friend selection and invite delivery. This approach is commonly used in multiplayer games that rely on Steam lobbies and want to provide a familiar invite flow without implementing custom UI.
Reacting to Overlay Events
This example demonstrates how to react to Steam Overlay-related events using explicit subscriptions.
The Subscribe to Overlay Activated node is used to listen for changes in the overlay’s active state. The callback receives a boolean value indicating whether the overlay has been opened or closed.
This is typically used to pause gameplay, mute audio, or adjust input handling while the overlay is visible.
The Subscribe to Join Requested node listens for incoming join requests triggered through Steam, such as accepting a game invite from a friend. The callback provides a join request structure that can be passed to other subsystems, such as Lobbies, to handle the join flow.
The On Requested callback is triggered on the local client when the player accepts a Steam invite or chooses to join a game through the Steam Overlay. This event indicates that the local user intends to join an external lobby, not that another user is joining the current lobby.
The provided FSteamJoinRequest contains the target lobby ID and optional connection data. The lobby ID is then passed to the Lobbies subsystem to initiate joining the requested lobby.
When overlay events are no longer needed, for example when leaving a menu or shutting down multiplayer features, the stored listener handles are passed to the corresponding Unsubscribe nodes.
Explicitly unsubscribing ensures that callbacks are no longer triggered and prevents outdated or unintended event handling.
Important Notes
- Steam Overlay availability depends on user settings and platform support
- Overlay activation and join requests are event-driven and should not be polled
- Event subscriptions should always be unsubscribed when no longer relevant
- Steam manages all overlay UI and input while it is active