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)
{
FActorSpawnParameters SpawnInfo;
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);
actor->SetActorLocation(position);
return actor;
}
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);â?
Was there anything added to the project other than the code you posted above? Also, could you post a screenshot of the error youâre receiving when you try to use PIE?
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.
This still seems to be happening 4.8.3. I tried setting bNoCollisionFail to false but the assert failure still occurred. Are there any updates to this issue?
Could you provide more information on what youâre doing and exactly what error youâre getting? Additionally posting the logs and callstack from your crash will help identify the crash.