Hi there!
I tried to do some kind of 3D healthbars for some actors in my game. I want to do this by adding an UMG widget-component to the actor blueprint.
If I start playing without a dedicated server everything works fine. But if do use a dedicated server, the editor crashes as soon as I start playing. I tried to add the widget with some delay via the event graph, but unfortunately without success.
This is the report I get:
UE4Editor_UMG!FWidget3DHitTester::GetBubblePathAndVirtualCursors() + 591 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\umg\private\components\widgetcomponent.cpp:154] UE4Editor_SlateCore!FHittestGrid::GetWidgetPathAndDist() + 365 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\slatecore\private\input\hittestgrid.cpp:628] UE4Editor_SlateCore!FHittestGrid::GetBubblePath() + 362 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\slatecore\private\input\hittestgrid.cpp:148] UE4Editor_Slate!FSlateApplication::LocateWindowUnderMouse() + 532 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:831] UE4Editor_Slate!FSlateApplication::UpdateToolTip() + 217 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:2640] UE4Editor_Slate!FSlateApplication::Tick() + 1652 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:1236] UE4Editor!FEngineLoop::Tick() + 4447 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\launchengineloop.cpp:2284] UE4Editor!GuardedMain() + 1404 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\launch.cpp:142] UE4Editor!GuardedMainWrapper() + 26 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\windows\launchwindows.cpp:126] UE4Editor!WinMain() + 249 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\windows\launchwindows.cpp:202] UE4Editor!__tmainCRTStartup() + 329 bytes [f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c:618]
When debugging into the mentioned function (GetBubblePathAndVirtualCursors) I found the problem lies here:
ULocalPlayer* const TargetPlayer = GEngine->GetLocalPlayerFromControllerId(World.Get(), 0);
APlayerController* PlayerController = TargetPlayer->PlayerController;
TargetPlayer is NULL and thereby causes an access violation. It seems to be NULL, because the server holds no local player (as intended).
I tried to reproduce this behaviour on a clean ThirdPerson template project, which was not successfull. In the template the server holds a localplayer and therefor does not crash.
I would like to know the best way to fix this, be it a
workaround or fixing some kind of error/design flaw that I made.
Greetings and thanks in advance!