C++ equivalent of Do Once

I really like the Do Once macro. However, it can only be used in blueprints. I want to use this in C++. Does anyone know what is the equivalent of this macro in C++??

Just a normal bool and if statement.

if (bDoOnce)
{
    // code
    bDoOnce = false;
}
2 Likes

I hadn’t thought of that. Thanks for the help once again, Dan!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.