I am very confused. I have a BP class that inherits from a C++ class, however the type is not the same.
So my inheritance is like this
- APawn
- ACharacter
- ARPGProjectCharacter
- ACharacterBase
- BP_CharacterBase
======================================================
What I am trying to accomplish is when my BP_CharacterBase overlaps a health pickup, I then call an UpdateHealth(HealAmount) from a cast to ACharaterBase.
class ACharacterBase* PlayerCharacter = Cast(UGameplayStatics::GetPlayerCharacter(GetWorld(), 0));
=========================================================
Then I have the overlap where I check for PlayerCharacter that is defined above. However this is where I am having an issue. So the check is looking for ACharacterBase, but it appears ACharacterBase != BP_CharacterBase. So what is the type of BP_CharacterBase so I can do a cast and then check for it?
void AHealingPickup::OnOverlapBegin(class UPrimitiveComponent* OverlappedComp, class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
{
if(OtherActor == PlayerCharacter)
{
PlayerCharacter->UpdateHealth(HealAmount);
PlayerCharacter->GetHealth();
GEngine->AddOnScreenDebugMessage(1, 3, FColor::Yellow, FString::Printf(TEXT("Overlap Begin")));
}