Well yes, you just said to the computer that “Character” is a pointer to an ATestingCCharacter object, but right now, it isn’t pointing to anything since you didn’t put “Character = something” anywhere. If this code is inside your character class, then you can just leave the Character part out.
void ATestingCCharacter::BeginPlay()
{
Super::BeginPlay();
UHealthComponent* HealthComp = FindComponentByClass<UHealthComponent>();
if (HealthComp)
{
// Found the health component. You can now access it safely.
// You can get the current health like this HealthComp->GetHealth();
}
}