lightbulb-cfl-onVibration System Overview

The template includes a lightweight Vibration System that handles haptic feedback across supported platforms.

Supported Platforms

  • PC (Gamepad)

  • Android

  • iOS

  • WebGL (gamepad vibration not supported on WebGL)

Triggering Vibration

To activate a vibration effect, use:

GameController.VibrationManager.Vibrate(duration, intensity);

Both parameters are float values:

  • duration - how long the vibration lasts (in seconds)

  • intensity - strength of the vibration, from 0 to 1

Quick Access Methods

For convenience, the VibrationManager provides predefined vibration patterns:

public virtual void LightVibration()  => Vibrate(0.08f, 0.4f);
public virtual void MediumVibration() => Vibrate(0.1f, 0.6f);
public virtual void StrongVibration() => Vibrate(0.15f, 1f);

MacOS Note

On some MacOS devices, a haptic-related error may occur when building the game. Refer to the Haptic iOS Build Error page for instructions on how to fix it.

Last updated