Implementation Example
Blueprint Implementation Example
1. Create an Opt-In UI Widget:
Design a widget that includes the necessary buttons and text.
2. Trigger Opt-In Logic:
Use a Branch node in
Event BeginPlay
to check theOptInStatus
.If the player has opted in, call the
StartRecording
function.If not, display the opt-in widget.
C++ Implementation Example
Explanation of the Code:
BeginPlay
: On game start, checks theOptInStatus
. If the player has opted in, recording starts automatically.OptIn
: This method sets theOptInStatus
to true, shares the player's information, and starts recording.SharePlayerInfo
: Handles the logic for sharing player information upon opt-in.
Opt-In Flow in Unreal Engine:
Initial Display: The opt-in prompt appears at the beginning of the game if the player hasn't previously opted in.
Player Decision:
Opt-In: The player’s decision is saved, their information is shared, and recording begins.
Ignore: The prompt is dismissed without recording, and the player is re-prompted later.
Learn More: Provides additional information about opting in.
Last updated