Basically I have a project that runs just fine in Editor but crashes when I package it and run it. I pinpointed the reason and it appears to be in this line, where I tell the player to crouch in case there’s a certain object in front of it (using raycasting here)
Player->Crouch();
This code is in a component. Player is defined as so
Player = (AZombieRunner_BPCharacter*)this->GetOwner();
As this works just fine in the editor, how can I fix it? Any idea why it’s happening?
I get this in the log. No important previous information
[2016.11.06-16.36.15:191][374]LogWindows:Error: === Critical error: ===
Fatal error!
[2016.11.06-16.36.15:255][374]LogExit: Executing StaticShutdownAfterError
[2016.11.06-16.36.15:860][374]LogPhysics:Warning: PHYSX: ..\..\PhysX\src\NpScene.cpp (2946) 8 : PxScene::unlockWrite() called without matching call to PxScene::lockWrite(), behaviour will be undefined.
[2016.11.06-16.36.15:860][374]LogPhysics:Warning: PHYSX: ..\..\PhysX\src\NpScene.cpp (2946) 8 : PxScene::unlockWrite() called without matching call to PxScene::lockWrite(), behaviour will be undefined.
[2016.11.06-16.36.15:885][374]LogWindows: FPlatformMisc::RequestExit(1)
[2016.11.06-16.36.15:885][374]Log file closed, 11/06/16 16:36:15
So I changed the line for
if (Player) { Player->Crouch(); }
The problem remains. What exactly do you mean with standalone? Isn’t it the same as packaging it? Kinda new to this
This is what I get in the dump. Still, can’t see what I’m doing wrong. How can it work if running inside the editor but not after being packaged for shipping?
If I debug with VS, it seems that it can’t read the memory for any of the variables of the component. What’s going on?
Ok, so it’s fixed now. There was no problem with the Player being null, and I actually fixed two things at the same time so one of them fixed the main problem:
Made sure I was checking if the Player existed AND if the Player could crouch (Player->CanCrouch())
Made sure the code was executed only one time per object (makes sense in my case). So the player only receives a Crouch() call instead of receiving like 10 in a row