Is this in your cpp file?
If so, you’ll need to define the scope of the function to the class its in. Such as:
void AMyActorClass::OnPlayerEntersPickup(UPrimitiveComponent * OverlappedComp, AActor * OtherActor, UPrimitiveComponent * OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult & SweepResult)
{
Destroy();
}
“AMyActorClass” being the class this function is coming from. It will also probably need to come from AActor to use Destroy( ).