# Sandbox.Input.TriggerHaptics

## Overload 1

```csharp
static void TriggerHaptics(float leftMotor, float rightMotor, float leftTrigger = 0, float rightTrigger = 0, int duration = 500)
```

Trigger a haptic event on supported controllers including Xbox trigger impulse rumble.

## Remarks

SDL will translate these commands into haptic pulses that should work on all controller types.

### Parameters

- `leftMotor` (`float`): The speed of the left motor, between 0.0 and 1.0.
- `rightMotor` (`float`): The speed of the right motor, between 0.0 and 1.0.
- `leftTrigger` (`float`), default `0`: (Xbox One controller only) The speed of the left trigger motor, between 0.0 and 1.0.
- `rightTrigger` (`float`), default `0`: (Xbox One controller only) The speed of the right trigger motor, between 0.0 and 1.0.
- `duration` (`int`), default `500`: How long (in milliseconds) should we apply this for?

## Overload 2

```csharp
static void TriggerHaptics(HapticEffect pattern, float lengthScale = 1, float frequencyScale = 1, float amplitudeScale = 1)
```

Trigger haptics based on a predefined [Sandbox.HapticEffect](/api/Sandbox.HapticEffect).
All [Sandbox.HapticEffect](/api/Sandbox.HapticEffect)s are normalized (start at 0, peak at 1).

### Parameters

- `pattern` (`HapticEffect`): The pattern to use
- `lengthScale` (`float`), default `1`: The amount to scale the pattern's length by.
- `frequencyScale` (`float`), default `1`: The amount to scale the pattern's frequency by.
- `amplitudeScale` (`float`), default `1`: The amount to scale the pattern's amplitude by.

## Overload 3

```csharp
static void TriggerHaptics(HapticEffect pattern, float frequencyScale, float amplitudeScale)
```

Trigger haptics based on a predefined [Sandbox.HapticEffect](/api/Sandbox.HapticEffect).
All [Sandbox.HapticEffect](/api/Sandbox.HapticEffect)s are normalized (start at 0, peak at 1).

### Parameters

- `pattern` (`HapticEffect`): The pattern to use
- `frequencyScale` (`float`): The amount to scale the pattern's frequency by.
- `amplitudeScale` (`float`): The amount to scale the pattern's amplitude by.

Declared in [Sandbox.Input](/api/Sandbox.Input).
Assembly: `Sandbox.Engine`.
