Fab Store

Do Once

A standard Unreal Engine flow-control macro that allows execution through only once, then blocks later triggers. Firing the Reset pin opens it again.

Category: Flow Control Level: Beginner C++ / Macro: StandardMacros::DoOnce

YouTube Video Lesson (#03)

Interactive Blueprint Graph & Copyable Code

Use the "Copy Nodes" button in the graph below, then press Ctrl+V in an Unreal Engine 5 Blueprint Graph to paste the example:

Input and Output Pins

Pin Name Direction Data Type Default Description
(Exec In) Input Exec (White) - Incoming execution. If the gate is open, it runs Completed and closes the gate.
Reset Input Exec (White) - Resets Do Once and allows the next execution signal through.
Start Closed Input Boolean (Red) False When True, the node starts closed. The first signal is blocked until Reset fires.
Completed Output Exec (White) - Output executed only for the first trigger while the gate is open.

Blueprint Flow from the Video

Print a Message Once with Box Overlap

When the player enters the Box, On Component Begin Overlap fires. The event's Other Actor output is compared with Get Player Pawn. If the result is true, the Branch sends execution to Do Once.

On the first entry, Completed runs and Print String displays "Emir entered.". Do Once then closes, so leaving and entering the area again does not print another message. In this example, Reset is not connected.

ESC