[Resolved]SpawnActor failed ? Spawning a Blueprint.
Hi, I am returning to UE4 after some time and ran into an issue with updating my project to 4.6 version. The latest tested and working version for my project was 4.5.1. Now I tried this 2 ways, first I just opened the project in 4.6 and it automatically compiles it to 4.6 version, then I also tried recreating the whole project from start. I ended up with same problem, I can't seem to spawn blueprints, the log says:
" SpawnActor failed because no class was specified "!
The rest of the game works fine. I assume the problem is something about ObjectInitializer which seems to have changed from FPostConstructInitializeProperties& PCIP way of doing it ?? I tried it both ways, no luck so far.
Here's the code , .h:
// and so on... .cpp:
and so on... and the spawning part:
Well I figured out what the problem was, it has something to do with the new blueprint system, it lost access to variables from parent Class, similar to problem described here: https://answers.unrealengine.com/questions/145043/460-cant-get-variables-from-other-blueprint-like-4.html In my case the problem is with GameModeBlueprint, simply put if I choose my GameModeBlueprint in the World Settings, I can call all the functions from parent GameMode C++ class, however the function can't seem to access some the variables. it can access int32 and such variables, but not arrays , pointers to BPs, etc. If I "Force Legacy Menuing system" in the "Blueprint Editor" , the problem stays. So instead of spawning Frogs in the MyGameMode->SpawnFrogsFunction, I created a BlueprintImplementableEvent:
this way I can just do this from the function: this->SpawnFrogFromBP(FVector(220, 220, 60));
And do the SpawnActor back in the Blueprint, which works great. It took me way too long to find what was causing this problem, but now it works. Hopefully this will help others with same problem!
BPs Are Set?
Are you sure FrogBP and SlotBP are set properly and that you are using your Blueprint version of your Game Mode?
answered Dec 16 '14 at 07:30 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here