I would like to know how to make this work.
ConstructorHelpers::FObjectFinder<UClass> BlueprintObject(L"Blueprint'/Game/Blueprints/Blueprint_Effect_Explosion.Blueprint_Effect_Explosion'");
FActorSpawnParameters SpawnParams;
SpawnParams.Instigator = Cast<APawn>(Owner);
SpawnParams.bNoFail = true;
GWorld->SpawnActor<UBlueprint>(BlueprintObject.Object, GetActorLocation(), FRotator(0, 0, 0), SpawnParams);
UObjectGlobals.cpp(2204): Fatal error:
FObjectFinders can't be used outside of constructors to find Blueprint'/Game/Blueprints/Blueprint_Effect_Explosion.Blueprint_Effect_Explosion'
UE4Editor.exe has triggered a breakpoint.
I would like to know how to make this work. The reference to the blueprint is correct. I have checked.
Rama
(Rama EverNewJoy)
May 24, 2014, 3:28am
2
#Spawning Blueprints
I gave the world my SpawnBP template function to make doing this easy
#Wiki Tutorial
After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...
Reading time: 1 mins 🕑
Likes: 14 ❤
Rama
Ugh, please may I have an example of how to load the blueprints UClass* and call the function using that. Sorry.
Kochab
(Kochab)
May 26, 2014, 11:06pm
4
Hi, Rama. I’m wondering how you get the actor blueprint. Are you doing it like this?:
ConstructorHelpers::FObjectFinder<UBlueprint> BlueprintObj(TEXT("Blueprint'/Game/Blueprints/BP.BP'"));
BPptr = NULL; /*UBlueprint* BPptr;*/
if (BlueprintObj.Succeeded())
BPptr = BlueprintObj.Object;
And then you’d pass in BPptr
to this?:
AActorBaseClass* NewActor = UFunctionLibrary::SpawnBP<AActorBaseClass>(GetWorld(), TheActorBluePrint, SpawnLoc, SpawnRot);
DoctorPC_1
(Johannesmajamäki)
August 26, 2014, 4:00pm
6
What was left unclear to me is, where exactly do I put the function in? It syas I should put it in the .h file of the tepmlate, but in what kind of .h file do I put it in (actor, pawn, etc.) Thanks!