Hi all, so I’ve just started getting into UE4 and have been tinkering around things working on a prototype for a game. I’m far more used to using C++ than working with blueprints. From what I’ve read you can spawn blueprints through C++. I’m currently trying to spawn a blueprint from C++ and using the following method that I’ve found to be the general consensus of how to spawn it through C++.
static ConstructorHelpers::FObjectFinder<UBlueprint> RockOb(TEXT("Blueprint'/Game/Blueprints/RockBP.RockBP'"));
RockBP = (UClass*)RockOb.Object->GeneratedClass;
However, I receive the following error in Visual Studios
“More changes are planned for GENERATED_BODY with the 4.7 release and users with existing code may wish to delay switching existing classes until then.”
You now define and use “normal” C++ constructors for your classes. You can use parameterless constructors too now!
You no longer need to supply a category for your properties to expose them to the editor or Blueprints. You’ll get a default category now.
FPostContructInitializeProperties is deprecated. It’s replaced by FObjectInitializer, and you only have to specify it when you actually need it
“GENERATED_BODY” no longer resets your protection level to “public”. It will preserve your settings.
Please use the new “GENERATED_BODY” specifier instead of “GENERATED_UCLASS_BODY”. It enables many of these new improvements!
I have been trying to make this work in all sort of ways including the FClassFinder suggestion below , but either it didn’t compile or something goes wrong when running the game.
I posted a question last week:
Anyway, if you add #include “Engine.h” at start of your .cpp that error on your screenshot will go away and you can compile, it will not fix the problem thou,
I tried that already :P.