Using NewObject inside PostInitProperties and creating a BP of the class will cause the editor to crash on PIE if the BP is is set in gamemode defaults
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Test) UCapsuleComponent* PlayerComponent; virtual void PostInitProperties() override;
void AMyPawn::PostInitProperties()
{
Super::PostInitProperties();
PlayerComponent = NewObject<UCapsuleComponent>(this);
PlayerComponent->AttachTo(RootComponent);
}
Result:
The editor crashes after clicking Play button
MachineId:9FA88CA44B7C623122B0039D6C8BA1B0 EpicAccountId:c807849e05a0413d99e379f2802cae9c Access violation - code c0000005 (first/second chance not available) "" UE4Editor_Engine!UWorld::EncroachingBlockingGeometry() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\engine\private\levelactor.cpp:987] UE4Editor_Engine!AGameMode::ChoosePlayerStart_Implementation() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\engine\private\gamemode.cpp:1455] UE4Editor_Engine!AGameMode::execChoosePlayerStart() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\engine\classes\gameframework\gamemode.h:67] UE4Editor_CoreUObject!UFunction::Invoke() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\coreuobject\private\uobject\class.cpp:4195] UE4Editor_CoreUObject!UObject::ProcessEvent() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:1046] UE4Editor_Engine!AActor::ProcessEvent() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\engine\private\actor.cpp:580] UE4Editor_Engine!AGameMode::ChoosePlayerStart() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\intermediate\build\win64\ue4editor\inc\engine\engine.generated.1.cpp:4557] UE4Editor_Engine!AGameMode::FindPlayerStart_Implementation() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\engine\private\gamemode.cpp:379] UE4Editor_Engine!AGameMode::execFindPlayerStart() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\engine\classes\gameframework\gamemode.h:67] UE4Editor_CoreUObject!UFunction::Invoke() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\coreuobject\private\uobject\class.cpp:4195] UE4Editor_CoreUObject!UObject::ProcessEvent() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:1046] UE4Editor_Engine!AActor::ProcessEvent() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\engine\private\actor.cpp:580] UE4Editor_Engine!AGameMode::FindPlayerStart() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\intermediate\build\win64\ue4editor\inc\engine\engine.generated.1.cpp:4565] UE4Editor_Engine!AGameMode::InitNewPlayer() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\engine\private\gamemode.cpp:1016] UE4Editor_Engine!AGameMode::Login() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\engine\private\gamemode.cpp:1057] UE4Editor_Engine!UWorld::SpawnPlayActor() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\engine\private\levelactor.cpp:665] UE4Editor_Engine!ULocalPlayer::SpawnPlayActor() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\engine\private\localplayer.cpp:219] UE4Editor_Engine!UGameInstance::StartPIEGameInstance() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\engine\private\gameinstance.cpp:253] UE4Editor_UnrealEd!UEditorEngine::CreatePIEGameInstance() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\editor\unrealed\private\playlevel.cpp:3137] UE4Editor_UnrealEd!UEditorEngine::PlayInEditor() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\editor\unrealed\private\playlevel.cpp:2385] UE4Editor_UnrealEd!UEditorEngine::StartQueuedPlayMapRequest() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\editor\unrealed\private\playlevel.cpp:1066] UE4Editor_UnrealEd!UEditorEngine::Tick() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\editor\unrealed\private\editorengine.cpp:1244] UE4Editor_UnrealEd!UUnrealEdEngine::Tick() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\editor\unrealed\private\unrealedengine.cpp:366] UE4Editor!FEngineLoop::Tick() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\launch\private\launchengineloop.cpp:2428] UE4Editor!GuardedMain() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\launch\private\launch.cpp:142] UE4Editor!GuardedMainWrapper() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\launch\private\windows\launchwindows.cpp:126] UE4Editor!WinMain() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\launch\private\windows\launchwindows.cpp:200]
Head over to the existing Questions & Answers thread and let us know what's up.
0 |
Component | UE - Gameplay - Blueprint |
---|---|
Affects Versions | 4.9.2 |
Target Fix | 4.13 |
Created | Oct 23, 2015 |
---|---|
Resolved | May 16, 2016 |
Updated | Apr 27, 2018 |