# How do I spawn Blueprints?

**URL:** <https://forums.unrealengine.com/t/how-do-i-spawn-blueprints/284104>\
**Category:** Blueprint\
**Tags:** spawn, unreal-engine, CPP, Blueprint, question\
**Created:** [May 23, 2014, 10:10pm UTC](https://forums.unrealengine.com/t/how-do-i-spawn-blueprints/284104 "2014-05-23T22:10:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_bda7d120](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_bda7d120](https://forums.unrealengine.com/u/anonymous_user_bda7d120)\
**Post date:** [May 23, 2014, 10:10pm UTC](https://forums.unrealengine.com/t/how-do-i-spawn-blueprints/284104/1 "2014-05-23T22:10:24Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [May 24, 2014, 3:28am UTC](https://forums.unrealengine.com/t/how-do-i-spawn-blueprints/284104/2 "2014-05-24T03:28:37Z")

</div>

#Spawning Blueprints

I gave the world my SpawnBP template function to make doing this easy

#Wiki Tutorial

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> 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...

Rama

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_bda7d120](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_bda7d120](https://forums.unrealengine.com/u/anonymous_user_bda7d120)\
**Post date:** [May 24, 2014, 4:20pm UTC](https://forums.unrealengine.com/t/how-do-i-spawn-blueprints/284104/3 "2014-05-24T16:20:29Z")

</div>

Ugh, please may I have an example of how to load the blueprints UClass\* and call the function using that. Sorry. 😕

---

<div class="post-metadata">

**Author:** ![Kochab](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kochab](https://forums.unrealengine.com/u/Kochab)\
**Post date:** [May 26, 2014, 11:06pm UTC](https://forums.unrealengine.com/t/how-do-i-spawn-blueprints/284104/4 "2014-05-26T23:06:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_bda7d120](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_bda7d120](https://forums.unrealengine.com/u/anonymous_user_bda7d120)\
**Post date:** [May 28, 2014, 8:59am UTC](https://forums.unrealengine.com/t/how-do-i-spawn-blueprints/284104/5 "2014-05-28T08:59:11Z")

</div>

does it work?

---

<div class="post-metadata">

**Author:** ![DoctorPC\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DoctorPC\_1](https://forums.unrealengine.com/u/DoctorPC_1)\
**Post date:** [August 26, 2014, 4:00pm UTC](https://forums.unrealengine.com/t/how-do-i-spawn-blueprints/284104/6 "2014-08-26T16:00:25Z")

</div>

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!
