How do I reference a blueprint in another blueprint (costum classes)
I wrote two C++-Classes named "SomSpell" and "SomSpellbook" deriving from AActor. Now I want the Spellbook-Blueprint to have a reference to the corresponding Spell-Blueprint.
In the Spellbook-Class I already established a variable for this:
But in the Blueprint of the Spellbook I can't choose my Spell-Blueprint. Even drag and drop doesn't work.
What am I doing wrong?
asked Aug 28 '15 at 04:56 PM in C++ Programming
Thats because there no object related to ASomSpell does not exist, you need to spawn actor first then you will be able to use it and thats only possible in runtime. So insted of using object as a varable use UClass*. UClass is class identifier and it's generated for each C++ and Blueprint class, you use it then class is needed for argumante, for example in SpawnActor. So make UClass* or:
When you use UClass* you will have all classes in engine listed, when you use TSubclassOf which works same as UClass* (actully it's mask) editor will limit the class selection to specific class relation.
Now from that variable you can spawn specific spell selected in that varable with GetWorld->SpawnActor(ResultingSpell) and returning value store in some spell array or whatever in spell book (??? don't know what system you exacly making :p)
answered Aug 28 '15 at 06:40 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here