Why Unrial crash when I spawn item?What Must i change?

void ACD_Spawner::SpawnFunc(UPrimitiveComponent* OverlappedComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
{
FVector Kull = UKismetMathLibrary::RandomPointInBoundingBox(BaseCollisionComponent->GetComponentLocation(), BaseCollisionComponent->GetScaledBoxExtent());

GEngine->AddOnScreenDebugMessage(-1, 15.0f, FColor::Yellow, Kull.ToString());
DrawDebugPoint(
	GetWorld(),
	Kull,
	20,  					//size
	FColor(255, 0, 255),  //pink
	false,  				//persistent (never goes away)
	1 					//point leaves a trail on moving object
);



FVector End = FVector(Kull.X, Kull.Y, (BaseCollisionComponent->GetComponentLocation().Z) - (BaseCollisionComponent->GetScaledBoxExtent().Z)+ 20);

GEngine->AddOnScreenDebugMessage(-1, 15.0f, FColor::Yellow, End.ToString());
DrawDebugPoint(
	GetWorld(),
	End,
	20,  					//size
	FColor(255, 0, 255),  //pink
	false,  				//persistent (never goes away)
	1 					//point leaves a trail on moving object
);
UWorld* Wor = GetWorld();
Wor->SpawnActor<ACD_PickableItem>(GetClass() , End, FRotator::ZeroRotator);

}

What class do you get with GetClass() in SpawnActor() ?

Oh, i see. When you call GetClass(), you actualy call this->GetClass() abdget ACD_Spawner, not ACD_Pickable item. I think that problem at this part

The problem was in the class that spawned