Instead of destroying the casing in OnHit, add SetLifeSpan to your constructor. that way you get a nice pile of shell casings accumulating on the floor for a short while. Simple change.
ACasing::ACasing()
{
// ...
// This will auto destroy after 5 seconds. You can use whatever delay you prefer
SetLifeSpan(5.0f);
}
void ACasing::OnHit(UPrimitiveComp||onent* HitComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit)
{
if (ShellSound)
{
UGameplayStatics::PlaySoundAtLocation(this, ShellSound, GetActorLocation());
}
// Remove following line:
//Destroy();
}