- Allow myself to bump it as it is the first result on Google and I keep searching for it -
C++
Option 1:
#include "Misc/EngineVersionComparison.h"
// Can use
UE_VERSION_NEWER_THAN
UE_VERSION_OLDER_THAN
// Example:
#if UE_VERSION_NEWER_THAN(5, 3, 0)
// 5.3.0 and up only code
#endif
#if UE_VERSION_OLDER_THAN(5, 3, 0)
// 5.3.0- only code
#endif
Option2:
#include "Runtime/Launch/Resources/Version.h"
// Then can access the following macros:
ENGINE_MAJOR_VERSION
ENGINE_MINOR_VERSION
ENGINE_PATCH_VERSION