Questions on PlayerState + Replication

Hey try doing it a bit safer mate.


// This is done from inside the character/ pawn class, but all you need is ether a Pawn or Controller to get the Player State
if (GEngine)
{
	const AYourPlayerController* PlayerPC = Cast<AYourPlayerController>(GetController());
	if (PlayerPC)
	{
		ATTSPlayerState* YourPlayerStateClass = Cast<ATTSPlayerState>(PlayerPC->PlayerState);
		if (YourPlayerStateClass)
		{
			GEngine->AddOnScreenDebugMessage(21, 1.0f, FColor::Red, FString::SanitizeFloat(YourPlayerStateClass->SomeVariable);
		}
	}
}

Also as mentioned above Health belongs in the character/ pawn, and Player State is for information about that player relevant to other players.
e.g: Score, Deahs, Player Name and so 4th.