Good call, zoombapup - I can’t believe that I missed the AMyHUD pointer check. Okay, so I’ll connect up the collision to the GameMode class. I got the same problem when I declared a pointer to the GameMode - CRASH…
I’m just thinking about how I would go about doing this. Do I do something like this? :
AsideScroller1GameMode::AsideScroller1GameMode()
{
//...
livesLeft = 10;
}
Then in the Tick function write
void AsideScroller1GameMode::Tick(float DeltaSeconds)
{
AMyActor *pMyActor = Cast<AMyActor>(UGameplayStatics::GetPlayerPawn(this, 0));
if(pMyActor)
{
pMyActor->DecrementLivesRemaining(livesLeft);
}
}