# Spawn derived class at runtime (blueprint derived from C++)

**URL:** <https://forums.unrealengine.com/t/spawn-derived-class-at-runtime-blueprint-derived-from-c/340127>\
**Category:** Blueprint\
**Tags:** spawn, unreal-engine, UE4, CPP, Blueprint, question\
**Created:** [November 30, 2015, 2:46pm UTC](https://forums.unrealengine.com/t/spawn-derived-class-at-runtime-blueprint-derived-from-c/340127 "2015-11-30T14:46:52Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![anonymous\_user\_41845f4a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_41845f4a](https://forums.unrealengine.com/u/anonymous_user_41845f4a)\
**Post date:** [November 30, 2015, 7:38pm UTC](https://forums.unrealengine.com/t/spawn-derived-class-at-runtime-blueprint-derived-from-c/340127/2 "2015-11-30T19:38:08Z")

</div>

Hello NegInfinity,

You should be able to fix this by making one change to the lines of code you provided. In this line:

```
ASpellProjectile *projectile = world->SpawnActor<ASpellProjectile>(testProjectileClass->GetClass(), transform, spawnParams);

```

Remove the “-\>GetClass()” part and just leave the variable name “testProjectileClass”. This should let the function know that you intend to spawn that class. You can find more information about this kind of setup from the following video.

> **[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 — https://unrealcommunity.wiki/! You will be able to find content from...

Hope this helps!

---

_[View the full topic](https://forums.unrealengine.com/t/spawn-derived-class-at-runtime-blueprint-derived-from-c/340127)._
