UGameplayStatics::GetPlatformName
#include "Kismet/GameplayStatics.h"
Access: public
Specifiers: staticBlueprintPure
Description
Returns the string name of the current platform (e.g. "Windows", "Mac", "Linux", "IOS", "Android", or a console platform name). Useful for implementing platform-specific behavior in Blueprint or C++ without compile-time checks.
Caveats & Gotchas
- • Platform names are case-sensitive and may change between engine versions; prefer compile-time macros (PLATFORM_WINDOWS, PLATFORM_IOS, etc.) for shipping code where possible.
- • In editor PIE, returns the host platform rather than a simulated target platform — a Windows editor running a mobile preview still returns "Windows".
- • Does not distinguish between platform variants (e.g. "Android" covers all Android device tiers).
Signature
static ENGINE_API FString GetPlatformName(); Return Type
FString Example
Branch behavior by platform at runtime C++
FString Platform = UGameplayStatics::GetPlatformName();
if (Platform == TEXT("IOS") || Platform == TEXT("Android"))
{
EnableMobileUI();
}
else
{
EnableDesktopUI();
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?