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.
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
:
- 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 typingSGGameModeBase
in the Search box. WhenSGGameModeBase
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
SGGameModeBase
as theDefault GameMode
. You can do this by navigating toProject Settings > Project > Maps & Modes > Default Modes > Default GameMode
.