FPS
Please read the plugin documentation beforehand.
Examples are available for each compatible version of Unreal Engine in the Plugin Sample repository
Before launching any example, the project source files must be regenerated to allow Unreal to place the plugin DLLs in the right place (or it will crash when the example is played).
To do this :
In Windows Content Explorer, right-click on the .uproject file and select Generate Visual Studio Project Files
.
The “4_FPS” example is an illustration of haptic integration into interactions. It uses the FPS starter content from Unreal Engine. The map blueprint can be found in SkineticSDK Content → 4_FPS → FirstPersonBP → Maps.
The integration is made in two blueprints: FirstPersonGameMode and FirstPersonCharacter. (Both located in the SkineticSDK Content → 4_FPS → FirstPersonBP → Blueprints folder)
- As in any of the examples, a Skinetic Device Data Asset is created and set as default device in Project Settings > Plugins > Skinetic.
Connection, disconnection and pattern loading are handled in the FirstPersonGameMode blueprint:
Get Default Device
is used to retrieve and store a reference to the Skinetic device set in plugin parameters.Skinetic Connect
function handles the connection to the default device.Two Skinetic Pattern (Obj. references) variables were added to the blueprint. Each variable references a pattern previously created with Unitouch Studio and loaded in the content browser.
The patterns are loaded into the connected device with
Load Pattern
.The patterns are unloaded in the same manner at the end of the play with
Unload Pattern
.The device is then
Disconnected
.
The two effects interactions are added to the FirstPersonCharacter blueprint:
A Skinetic Effect component is added for each pattern to play. It references the pattern loaded in the previous blueprint.
Several parameters can be altered in the details panel. For example, for the Recoil effect, the Volume is amplified to 140% of its original setting and the Priority is set to 1 as this effect is more important than the other one.
The Recoil effect is played after the firing sound.
Playing Type
is set to Pool (multiple instances of this effect can be played simultaneously).The Bounce effect is played when the input action for jumping is pressed and stopped when released (if not already finished).
Playing Type
is set to Default (only one instance of the effect can be played concurrently - the effect will not play if another instance of the same effect [ie. the same component] is already playing). TheStop
node is called with its parameter Time set to 0.05 seconds: the effect will progressively be attenuated during 0.05 seconds before stopping (if not naturally stopped before).