> ## 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.

# IGameInputDevice::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 概觀](/zh-TW/build/core-features/common/input/overviews/input-overview)。

## 需求

**標頭：** GameInput.h

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

## 版本歷程記錄

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


## Related topics

- [IGameInputDevice::SetForceFeedbackMotorGain](/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_setforcefeedbackmotorgain.md)
- [IGameInputDevice::SetHapticMotorState](/reference/input/gameinput/deprecated/interfaces/igameinputdevice/methods/igameinputdevice_sethapticmotorstate.md)
- [IGameInputForceFeedbackEffect::SetGain](/reference/input/gameinput/interfaces/igameinputforcefeedbackeffect/methods/igameinputforcefeedbackeffect_setgain.md)
