A Branch to detect Build type ? (Development/Shipping)

Hello !

So im working on a complex level system with many sublevels that are loaded one by one starting from sublevel 0 up to sublevel 99.

the problem is that with my current system i have to play them all starting from the sublevel 0
and you can imagine how annoying this is when i need to test level 54 and im forced to play them all one by one from the first one.

So i made a little system that allow me to bypass the normal level progression with an instance editable integer that i can just set to 55, that would force load level 55 first.

the thing is ; if i somehow forget to set it back to 0, my build would be broken.

The actual question :

Is it possible to have a branch that would check for the build type ?

imagine ;

  • if i play in editor or i build my game in developpment, the branch would return a FALSE
  • if i build the game in Shipping, the branch would return a TRUE

Is that possible ?

i know i can right click on nodes and set them to “developpment only” or “do not compile”
but that’s not really working if i need 2 different execution depending on the build type.

Thanks in advance !

/** Returns whether this is a build that is packaged for distribution */
UFUNCTION(BlueprintPure, Category="Development", meta=(BlueprintThreadSafe))
static ENGINE_API bool IsPackagedForDistribution();

You can just use this, also exposed to blueprint
Returns true for shipping, false otherwise

Awsome, thanks a lot!
That’s exactly what i needed.
here is how it look like in blueprint :