`Host` command crashes standalone games

Host works well in the editor, but when I launch a standalone game instance, it inexplicably crashes, and the VS debugging tool hints at some access violation in UE4Editor-Engine.dll, even though I have null guarded my Engine and World pointers (unlike @sampattuzzi, I don’t use the ensure...return pattern, simply checking them off in an if scope).

Also confirming:

  • tried replacing with ensure...return, doesn’t work
  • Wiped Binaries\Win64 and Intermediate and rebuilt .sln file, just to make sure
  • launching a standalone instance from within the editor crashes it instantly.

@DanM, @Rob? Anyone?

The solution, again, was something that was hiding behind a thin veil of ignorance.

I used ATriggerBox instead of AActor as the parent class for my APlatformTriggerBox, and smugly decided to access the sprite component so that it could be hidden within the game. Unbeknownst to me, that component doesn’t exist in standalone shipping or otherwise packaged builds, and hence was crashing the instance when I was trying to load the level outside the editor.

So, simply commenting out the line which was accessing the sprite component by GetSpriteComponent() solved this issue.

Community and future self, please don’t forget to ensure every single pointer you use for validity in the future, before packaging for release. :cold_sweat:

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms