With the stack trace going back to me calling SetRelativeLocation. What kind of check do I need to put around my code to have this crash not happen? Or better yet, is there any way to automatically stop ticking when the game ends?
Hey, unfortunately this doesn’t work. I’ve also tried checking if the world of the mesh is null since the crash line seems to be about projecting the new transform to the world or something, but they’re both valid.
It looks like you are trying to reference something that is no-longer there. As suggested by Schdek it is worth testing for a NULL reference, but then also check if it is valid
if (StaticMeshComp && StaticMeshComp->IsValidLowLevel())
{
StaticMeshComp->SetRelativeLocation(...);
}
In your example it looks like StaticMeshComp would be being set to a non-NULL value (0xFFFFFFFFFFFFFFFF) so the test for NULL will pass, as the value isn’t NULL. The IsValidLowLevel should check that the reference is valid and whatever it points too checks out.