Function run only in development build

How to create functions which run only in development build, so they are disabled in packaged builds. I’ve seen that feature in one of release notes, but no docs on site on it anymore.

Yeah, thanks

UFUNCTION(..., meta=(DevelopmentOnly))

I was searching for this keyword,

Hi Yata,

If you want to be able to tag any BP function as DevelopmentOnly; go to the editor preferences > Blueprint editor > Experimental > Allow explicit impure node disabling.

To declare custom made BP functions in code, add the following meta data; UFUNCTION(..., meta=(DevelopmentOnly)).
For C++ functions, simply wrap their implementation with the following;

void Foo()
{
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
...
#endif
}

Hope this helps. Cheers,

1 Like