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

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.

Hope this helps!