> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CreateForceFeedbackEffect

> CreateForceFeedbackEffect

# CreateForceFeedbackEffect

Uses the [IGameInputForceFeedbackEffect](/reference/input/gameinput/interfaces/igameinputforcefeedbackeffect/igameinputforcefeedbackeffect) interface to track the force feedback effect acting upon a motor.

## Syntax

```cpp theme={null}
HRESULT CreateForceFeedbackEffect(
    uint32_t motorIndex,
    const GameInputForceFeedbackParams* params,
    IGameInputForceFeedbackEffect** effect
);
```

### Parameters

*motorIndex*   \_In\_\
Type: uint32\_t

Index of the motor affected by the force feedback effect.

*params*   \_In\_\
Type: [GameInputForceFeedbackParams\*](/reference/input/gameinput/structs/gameinputforcefeedbackparams)

Parameters that define the nature of the force feedback effect.

*effect*   \_COM\_Outptr\_\
Type: IGameInputForceFeedbackEffect\*\*

The resulting [IGameInputForceFeedbackEffect](/reference/input/gameinput/interfaces/igameinputforcefeedbackeffect/igameinputforcefeedbackeffect) interface that tracks the life of the effect's resolution.

### Return value

Type: HRESULT

This function returns an error result if there are insufficient hardware resources to create the effect, or if the requested effect is not supported by the hardware.

## Remarks

The `CreateForceFeedbackEffect` method uses the `IGameInputForceFeedbackEffect` interface to track the force feedback effect acting upon a motor. If the tracked device is disconnected before the feedback effect finishes, its lifetime feedback effect is orphaned and will report its state as "stopped" until the resources are released. For more information, see [Overview of GameInput](/build/core-features/common/input/overviews/input-overview).

## Requirements

**Header:** GameInput.h

[GameInput](/reference/input/gameinput/gameinput_members)\
[IGameInputDevice](/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice)

## Version History

| Version | Changes     |
| ------- | ----------- |
| **v0**  | Introduced. |


## Related topics

- [Force feedback on GameInput](/build/core-features/common/input/advanced/input-forcefeedback.md)
- [GameInput force feedback interface](/build/core-features/common/input/hardware/input-hardware-force-feedback.md)
- [GameInputForceFeedbackConstantParams](/reference/input/gameinput/structs/gameinputforcefeedbackconstantparams.md)
- [IGameInputDevice](/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md)
- [GameInputForceFeedbackConditionParams](/reference/input/gameinput/structs/gameinputforcefeedbackconditionparams.md)
