Setting Up SGGameModeBase

After installing and enabling the SenseGlove Unreal Engine Plugin, the easiest and most straightforward approach to get started is to just set the default GameMode to SGGameModeBase from Edit > Project Settings... > Maps & Modes > Default Mode > Default GameMode. By doing this, the Default Pawn Class is automatically set to SGPawn, and the Player Controller Class is set to SGPlayerController. This setup ensures that a SenseGlove pawn will automatically spawn when you hit the play button in the editor.

Setting Up SGGameModeBase - Setting the default class SGGameModeBase

tip

For greater control and customization, consider extending the SGGameModeBase.

note

Currently, setting SGGameModeBase or a subclass of it as the Default GameMode is not a strict requirement. Its primary function is to ensure that a default SGPawn and SGPlayerController are set. However, this might change in the future, and it could become a mandatory setting.

important

While setting SGGameModeBase as the Default GameMode will automatically spawn the default SGPawn at BeginPlay and initiate communication with the SenseGlove devices, it will not display any virtual hands in your simulation by default. You might still need to configure the Virtual Hand Meshes and the Wrist Tracking Hardware separately.

important

Before starting the simulation in the editor, make sure that SenseCom is running and XR_EXT_hand_tracking is enabled. Without these, your simulation will not receive hand pose data from the SenseGlove devices.

Extending SGGameModeBase

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

  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 SGGameModeBase - 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 SGGameModeBase - Picking a Parent Class

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

Extending SGGameModeBase - Picking SGGameModeBase 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 SGGameModeBase - 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 SGGameModeBase - Renamed NewBlueprint to BP_SGGameMode

  1. Finally, set your newly created subclass of SGGameModeBase as the Default GameMode. You can do this by navigating to Project Settings > Project > Maps & Modes > Default Modes > Default GameMode.

Extending SGGameModeBase - Setting the default class BP_SGGameMode