How to get player steam id?

As i remember it should return the 64bit steamid as an FString if the platform is Steam.


FString SteamID = GetWorld()->GetFirstPlayerController()->PlayerState->UniqueId->ToString();




	 /** The id used by the network to uniquely identify a player.
	 * NOTE: the internals of this property should *never* be exposed to the player as it's transient
	 * and opaque in meaning (ie it might mean date/time followed by something else).
	 * It is OK to use and pass around this property, though. */
	UPROPERTY(replicatedUsing=OnRep_UniqueId)
	FUniqueNetIdRepl UniqueId; 



https://github.com/EpicGames/UnrealEngine/blob/release/Engine/Source/Runtime/Engine/Classes/GameFramework/PlayerState.h

1 Like