Spawn derived class at runtime (blueprint derived from C++)
Let's say I have a property in my actor class:
I want to set this property in editor (by dragging Blueprint derived from ASpellProjectile into property), and then spawn the class at runtime.
First, for some reason this doesn't work:
in this example tmp will always be null.
Second, attempting to spawn actor being referenced:
Results in message:
So, how do I actually spawn an actor from "template"/"preset"?
asked Nov 30 '15 at 02:46 PM in C++ Programming
You should be able to fix this by making one change to the lines of code you provided. In this line:
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!
answered Nov 30 '15 at 07:38 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here