UnrealScripterAI
Discord ↗
Link Copied to Clipboard
×
"script to trigger score when player acheives it"
void AScoreTrigger::NotifyActorBeginOverlap(AActor* OtherActor) { Super::NotifyActorBeginOverlap(OtherActor); if (OtherActor->IsA(APlayerCharacter::StaticClass())) { APlayerCharacter* PlayerCharacter = Cast<APlayerCharacter>(OtherActor); PlayerCharacter->AddScore(ScoreAmount); Destroy(); } }