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);
}