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

# SetForceFeedbackMotorGain

> IGameInputDevice::SetForceFeedbackMotorGain

# IGameInputDevice::SetForceFeedbackMotorGain

對馬達上所有已載入的效果套用全域衰減係數。

## 語法

```cpp theme={null}
void SetForceFeedbackMotorGain(
    uint32_t motorIndex,
    float masterGain
);
```

### 參數

*motorIndex*   \_In\_\
類型：uint32\_t

要變更之馬達的索引。

*masterGain*   \_In\_\
類型：float

套用至馬達上所有已載入效果的全域衰減係數，介於 0.0 與 1.0 之間。

### 傳回值

無。

## 備註

此方法會對馬達上所有已載入的效果套用全域衰減係數。`masterGain` 指標接受介於 0.0 與 1.0 之間的值。此值由應用程式的力回饋強度設定使用。如需詳細資訊，請參閱 [GameInput 概觀](https://docs.xbox.com/zh-TW/build/core-features/common/input/overviews/input-overview.md)。

## 需求

**標頭：** GameInput.h

[GameInput](https://docs.xbox.com/zh-TW/reference/input/gameinput/gameinput_members.md)\
[IGameInputDevice](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md)

## 版本歷程記錄

| 版本 | 變更 |
| - | - |
| **v0** | 已推出。 |


## Related topics

- [IGameInputForceFeedbackEffect::SetGain](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputforcefeedbackeffect/methods/igameinputforcefeedbackeffect_setgain.md)
- [IGameInputForceFeedbackEffect::GetGain](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputforcefeedbackeffect/methods/igameinputforcefeedbackeffect_getgain.md)
- [IGameInputDevice::SetHapticMotorState (已淘汰)](https://docs.xbox.com/zh-TW/reference/input/gameinput/deprecated/interfaces/igameinputdevice/methods/igameinputdevice_sethapticmotorstate.md)
- [IGameInputDevice (介面內容)](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md)
- [IGameInputForceFeedbackEffect (介面內容)](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputforcefeedbackeffect/igameinputforcefeedbackeffect.md)
