в .H прописываем:
TSubclassOf<class AActor> MySpawnBPClass;
в С++:
static ConstructorHelpers::FObjectFinder<UBlueprint> MySpawnBP(TEXT("Blueprint'/Game/BP/MyBP.MyBP'"));
if (MySpawnBP.Object != NULL)
{
MySpawnBPClass = (UClass*)MySpawnBP.Object->GeneratedClass;
}
UWorld* const World = GetWorld();
FVector position(0, 0, 0);
FRotator rotator(0, 0, 0);
FActorSpawnParameters SpawnInfo;
SpawnInfo.Owner = this;
if (World)
{
AActor* AC = GetWorld()->SpawnActor<AActor>(MySpawnBPClass, position, rotator, SpawnInfo);
}
_________________
https://www.facebook.com/groups/uejob/