I have this code from a course but I get the error
operand types are incompatible
(“AActor *” and “ACharacter *”)
void Apickup::OnPickedUp(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
{
if (OtherActor == UGameplayStatics::GetPlayerCharacter(this, 0)) {
Destroy();
}
}