Setting Up SGGameInstance

Setting SGGameInstance as the default Game Instance Class is very straightforward. You can do this by navigating to Project Settings > Project > Maps & Modes > Game Instance > Game Instance Class.

Setting Up SGGameInstance - Setting the default class SGGameInstance

tip

For greater control and customization, consider extending the SGGameInstance.

important

Currently, setting SGGameModeBase or a subclass of it as the default Game Instance Class is not a strict requirement. However, if you intend to use any SenseGlove console command it becomes mandatory. If not set, SenseGlove console commands will not be recognized by Unreal Engine.

Extending SGGameInstance

Follow these steps to extend and set up your own version of SGGameInstance:

  1. In the Content Browser, click the + Add button, then select Blueprint Class from the menu. Alternatively, right-click inside the Content Browser and choose Blueprint Class from the context menu.

Extending SGGameInstance - Adding a Blueprint Class

  1. A dialog will appear asking you to choose a parent class. Click on the ALL CLASSES section to expand the list of available classes.

Extending SGGameInstance - Picking a Parent Class

  1. In the expanded ALL CLASSES section, start typing SGGameInstance in the Search box. When SGGameInstance appears, select it and click the Select button to create your new Blueprint class based on it.

Extending SGGameInstance - Picking SGGameInstance as the Parent Class

  1. After returning to the Content Browser, the Unreal Editor will prompt you to rename NewBlueprint to your desired class name. You can rename the class at any time by pressing F2 or by right-clicking on it and selecting Rename from the context menu.

Extending SGGameInstance - Renaming NewBlueprint

  1. Once you have renamed the NewBlueprint class to your desired name, click on Save All to save the new class to disk.

Extending SGGameInstance - Renamed NewBlueprint to BP_SGGameInstance

  1. Finally, set your newly created subclass of SGGameInstance as the default Game Instance Class. You can do this by navigating to Project Settings > Project > Maps & Modes > Game Instance > Game Instance Class.

Extending SGGameInstance - Setting the default class BP_SGGameInstance