Is there an Event called at end of game?

Is there an event that is called at the end of the game? Let’s say you want to automatically save some game state information when a dedicated server is starting to shutdown. What event could you use to accomplish this?

When in the editor PreExit() is only called when the editor is being closed and GameEnding() seems to never be called in the engine. I tried overloading both of them with no luck :frowning:

#Game Mode

Check in game mode class!

There’s several

#GameEnding()

You probably want this one :slight_smile:

/** Engine is shutting down. */
virtual void PreExit() OVERRIDE;
	
//~~~
	
/** Called right before exiting or performing a server travel. */
virtual void GameEnding() OVERRIDE;

In current UE4 version, you need to override GameInstance::Shutdown();

Can you explain how? I have “method with override specifier ‘override’ did not override any base class methods” if i try.

virtual void Shutdown() override;