In 4.4 everything works fine but after upgrading my project to 4.5 I get an assertion during calling UWorld::SpawnActor( UClass* Class, const FActorSpawnParameters& SpawnParameters = FActorSpawnParameters()).
We’re still investigating this issue but I wanted to ask if you are still receiving the same error in the latest version of the engine? Do you receive the error message when trying to build the project or when running it in the editor or standalone/packaged game?
Does the crash occur for you in a new project? If so what steps are you taking that cause it to happen so that I can reproduce it on my end. Also, if you could post your log files from when the crash occurred it will help determine what the cause is.
to public section in header file of project player controller and
AActor* AMyProject4PlayerController::SpawnActor(TSubclassOf<AActor> actorClass, AActor* actorTemplate, FVector position)
SpawnInfo.bNoCollisionFail = true;
SpawnInfo.Owner = this;
SpawnInfo.Instigator = nullptr;
SpawnInfo.bDeferConstruction = false;
SpawnInfo.Template = actorTemplate;
auto world = GetWorld();
auto actor = world->SpawnActor<AActor>(actorClass, SpawnInfo);
to source file (of course you have to change the name of the class to correct one for you project). Then you compile and run project in the editor, open MyCharacter blueprint and add some nodes to Begin Play event (check image). When you start the game in PIE you should get the error.
I’m aware that this blueprint would run recursively (if it works correctly) but it’s the fastest way to show that issue. You could also create new player controller based on that from C++ and use those two Spawn Actor nodes in Begin Play event of player controller, then create new Game Mode (set default PC to the new one) and use that GM in World Settings.
I was able to use the code snippet you provided to reproduce a crash though it did not have the same error message. Just as a check, could you test if you are able to use PIE if you comment out or remove the line “actor->SetActorLocation(position);”?
There was nothing more added (only that function amd changed MyCharacter blueprint). Instead of screenshot (as editor is instantly closed after exception) I include callstack and log file (this is from version with new game mode as mentioned before).link text
I was able to reproduce the issue as you described and have submitted a report to our bug tracking system (UE-7071). As a temporary solution I found that changing “SpawnInfo.bNoCollisionFail” from true to false as well as omitting the line actor->SetActorLocation(position); will not cause the crash to occur.