I would like to know how to make this work.
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.
I gave the world my SpawnBP template function to make doing this easy
Ugh, please may I have an example of how to load the blueprints UClass* and call the function using that. Sorry.
Hi, Rama. I’m wondering how you get the actor blueprint. Are you doing it like this?:
BPptr = NULL; /*UBlueprint* BPptr;*/
BPptr = BlueprintObj.Object;
And then you’d pass in
BPptr to this?:
AActorBaseClass* NewActor = UFunctionLibrary::SpawnBP<AActorBaseClass>(GetWorld(), TheActorBluePrint, SpawnLoc, SpawnRot);
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!