Hello!
I am developing a multiplayer game, in which my GameMode calls a method from a spawn area, to obtain a random point in it. I call this method from my PostLogin method.
In the returnRandomPoint function I cannot access the GetComponentsBoundingBox, because my game crashes with an access violation.
It crashes in this if. (The if was just for testing purpose)
if (GetComponentsBoundingBox().Min.X == NULL)
{
UE_LOG(LogTemp, Warning, TEXT("Test"));
}
Do I have to declare the BoundingBox in the constructor or somewhere? Because all I have in my constructor is this:
PrimaryActorTick.bCanEverTick = true;
UBoxComponent* comp = CreateDefaultSubobject<UBoxComponent>(TEXT("test"));
RootComponent=comp;
This is the error I get:
MachineId:13D666B54D30E7423C3F99BE11422981
EpicAccountId:
Access violation - code c0000005 (first/second chance not available)
UE4Editor_SchulCS_4401!ASpawnArea::returnRandomPoint() [c:\users\user\documents\unreal projects\schulcs\source\schulcs\spawnarea.cpp:40]
UE4Editor_SchulCS_4401!ASchulCSGameMode::spawnPlayers() [c:\users\user\documents\unreal projects\schulcs\source\schulcs\schulcsgamemode.cpp:110]
UE4Editor_SchulCS_4401!ASchulCSGameMode::PostLogin() [c:\users\user\documents\unreal projects\schulcs\source\schulcs\schulcsgamemode.cpp:54]
UE4Editor_Engine!UWorld::SpawnPlayActor() [d:\build++ue4+release-4.13+compile\sync\engine\source\runtime\engine\private\levelactor.cpp:710]
UE4Editor_Engine!ULocalPlayer::SpawnPlayActor() [d:\build++ue4+release-4.13+compile\sync\engine\source\runtime\engine\private\localplayer.cpp:228]
UE4Editor_Engine!UEngine::LoadMap() [d:\build++ue4+release-4.13+compile\sync\engine\source\runtime\engine\private\unrealengine.cpp:10019]
UE4Editor_Engine!UEngine::Browse() [d:\build++ue4+release-4.13+compile\sync\engine\source\runtime\engine\private\unrealengine.cpp:9126]
UE4Editor_Engine!UGameInstance::StartGameInstance() [d:\build++ue4+release-4.13+compile\sync\engine\source\runtime\engine\private\gameinstance.cpp:358]
UE4Editor!FEngineLoop::Init() [d:\build++ue4+release-4.13+compile\sync\engine\source\runtime\launch\private\launchengineloop.cpp:2361]
UE4Editor!GuardedMain() [d:\build++ue4+release-4.13+compile\sync\engine\source\runtime\launch\private\launch.cpp:143]
UE4Editor!GuardedMainWrapper() [d:\build++ue4+release-4.13+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
UE4Editor!WinMain() [d:\build++ue4+release-4.13+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:202]
UE4Editor!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:264]
kernel32
ntdll
Thank you in advance for your help!