I have a class ATTSCharacter with some functions in it I need to call in my PlayerController.
So I have the following code, it compiles but doesn’t work:
void ATTSPlayerController::SetupInputComponent()
{
Super::SetupInputComponent();
ATTSCharacter* Character = Cast<ATTSCharacter>(GetControlledPawn());
GEngine->AddOnScreenDebugMessage(1, 1.0f, FColor::Red, FString::SanitizeFloat(Character->Health));
}
When the code executes it says: Access violation reading location 0x00000000000004F0.
Any ideas?