Why can`t cast??

hellow im unreal tutorial korean student
my english is so bad, plz understand my word

thanks you
i have a question for cast

void AEnemy::AddDamage(float fDamage)
{
int playerNowExp = 0;
int MonsterExp = 0;
int PlusExp = 0;

TArray<FTB_StageData*> StageDataList = LoadStageTableEnemy();

fHp -= fDamage;

if (fHp <= 0)
{

    AMySixHomeworkCharacter* player = Cast<AMySixHomeworkCharacter>(GetWorld()->GetFirstPlayerController());
    if (player == nullptr)
    {
        UE_LOG(LogTemp, Error, TEXT("character cast Fail"));
        return;
    }

    //get player data and StageData
    playerNowExp = player->GetnNowExp();
    MonsterExp = StageDataList[player->GetnLevel()]->monsterExp;
    PlusExp = playerNowExp + MonsterExp;

    //Set Player Exp
    player->SetnTExp(PlusExp);

    GetWorld()->DestroyActor(this);
}

}

above cord is my Enemy Hit cord by rinetrace
but cast fail to AMySixHomeworkCharacter
what`s wrong?

with out this case
every casting was fail

A Controller isn’t your character. It handles input for your character. You want the Controller’s owner.



AMySixHomeworkCharacter* player = Cast<AMySixHomeworkCharacter>(GetWorld()->GetFirstPlayerController()->GetOwner());