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
.
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
:
- In the Content Browser, click the
+ Add
button, then selectBlueprint Class from the menu
. Alternatively, right-click inside the Content Browser and chooseBlueprint Class
from the context menu.
- A dialog will appear asking you to choose a parent class. Click on the
ALL CLASSES
section to expand the list of available classes.
- In the expanded
ALL CLASSES
section, start typingSGGameInstance
in the Search box. WhenSGGameInstance
appears, select it and click theSelect
button to create your new Blueprint class based on it.
- 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 pressingF2
or by right-clicking on it and selectingRename
from the context menu.
- Once you have renamed the
NewBlueprint
class to your desired name, click onSave All
to save the new class to disk.
- Finally, set your newly created subclass of
SGGameInstance
as the defaultGame Instance Class
. You can do this by navigating toProject Settings > Project > Maps & Modes > Game Instance > Game Instance Class
.