Access project version in Unreal Engine
How to access the project's version in Unreal Engine and expose it to Blueprints
If you want to access your project version in C++ or Blueprints you can implement the following simple blueprint function library method, this can be included in an existing blueprint function library that you might have for your project, otherwise a new one can be created.
1
2
3
4
5
class MYGAME_API UMyFunctionLibrary : public UBlueprintFunctionLibrary
{
UFUNCTION(BlueprintPure)
static FString GetProjectVersion();
}
1
2
3
4
5
6
7
8
9
10
11
12
13
FString UMyFunctionLibrary::GetProjectVersion()
{
FString ProjectVersion;
GConfig->GetString(
TEXT("/Script/EngineSettings.GeneralProjectSettings"),
TEXT("ProjectVersion"),
ProjectVersion,
GGameIni
);
return ProjectVersion;
}
Now the following blueprint function can be called from any blueprint in your project to get the project version, and formatted as a string like so:
This post is licensed under
CC BY 4.0
by the author.