Skip to main content

Editable Parameters

Please read the plugin documentation beforehand.

Examples are available for each compatible version of Unreal Engine in the Plugin Sample repository

WARNING

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.

SkineticDeviceSetting


The “2_Parameters” level shows how some parameters of a haptic effect can be altered at runtime.

The example consists of a Widget Blueprint containing connection/disconnection buttons as well as a combobox to select the effect, spinboxes and checkboxes to change play parameters of the effect and play/stop buttons.

Parameters UI

  • As in any of the examples, a Skinetic Device Data Asset is created and set as default device in Project Settings > Plugins > Skinetic.

    SkineticDeviceSetting

  • A Skinetic Pattern object reference array is filled with all patterns we want to use in this example.

  • On initialization, the device is set as a variable for later use and the array of patterns used to fill the combobox.

  • When clicked, the “connect” button triggers a connection routine to the default device and enables the “disconnect” button. It also loads every pattern from the array into the sdk.

    Connect LoadPatterns

  • Reciprocally the “disconnect” button unloads the patterns, disconnects the device and enables the “connect” button.

    Disconnect

  • Each parameters of the play is editable in the UI as well as the global Boost setting. Each spinboxe is bound to a variable corresponding to the value to edit.

  • When changed the global Boost Setting slider will set the boost in the SDK. Disconnect

  • When pressed, the button “play” will get the selected effect in the combobox, play it with its edited parameters and store the effect ID returned by the Play Effect node.

    Play Effect With Custom Parameters

  • When pressed, the button “stop” will stop the effect with the previously stored ID.

    Stop Effect

  • The transformation parameters only affect the 2 last patterns as the first 3 are static.

  • A custom event is bound to the connection callback to display the vest's connection status in the UI. The serial number is formatted as a string with ConvertSerialNumbertoString().

    Callback