Skip to main content

Effect Accumulation Example

In this example the accumulation strategy feature can be tested following the Haptic Guidelines about Effect Accumulation.

img - Effect Accumulation Scene

Two similar patterns used in this scene, shot_fire.spn and shot_fire_light.spn.

The main one is made of an impact blast then a remaining burning effect on the impact area which contains several components (deep combustion, sparks and cracks).

However this effect does not work too well when triggered too much. Hence, the lighter version is triggered instead as it is only made of the impact blast and the sparks.

The accumulation between these two patterns can be configured on the left side, while the right side allows to configure a salvo from the 3 shooting spheres.

Automatic connection

The automatic connection is the same as the Basic UI Example using the same SkiEx_AutoConnect script.

PatternAssets

In this example, the 2 PatternAssets are added to the preload list of the SkineticDevice component.

img - Auto connection

Effect Accumulation Handling

Using the UI sliders, the user can set the duration of the accumulation window and the number of accumulated effects after the first one. The SkiEx_EffectAccumulation script then simply sets the accumulation using the reference to the haptic device.

Shooters

The SkiEx_EffectAccumulation script handles the HapticEffect component and sets its TargetDevice and TargetPattern through scripting. It also instantiates the bullets from the three shooters and passes them the reference to the HapticEffect to use. In order to render each bullet impact individually, the HapticEffect component is set to E_PULLED.

img - Effect Accumulation Handling