Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Gamepad never stops to vibrate

Discussion in 'Input System' started by Mars91, Feb 6, 2020.

  1. Mars91

    Mars91

    Joined:
    Mar 6, 2012
    Posts:
    564
    I'm using

    Gamepad.current.SetMotorSpeeds(0.1f, 0.1f);


    The gamepad (XboxOne controller connected via USB) start to vibrate but never stops.
     
  2. Rene-Damm

    Rene-Damm

    Unity Technologies

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    That's by design. What's happening there is akin to calling functions like XInputSetState, i.e. you put the gamepad into a certain state and it remains in that state until you change it.

    We should probably force-stop all haptics when exiting play mode, though. And maybe automatically pause them when play mode is paused.
     
  3. Mars91

    Mars91

    Joined:
    Mar 6, 2012
    Posts:
    564
    Oh thank you for your answer didn't find anything in the doc about this behaviour.
     
  4. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    802
    You should have added another parameter for vibration time.
     
    emredesu and mmartorell like this.
  5. CreaZyp154

    CreaZyp154

    Joined:
    Jul 22, 2019
    Posts:
    1
    Hi I'm having the same issue, except that i'm calling
    gamepad.all[idOfTheGamepadItsTheCorrectOneIDoubleChecked].ResetHaptics();
    , but it's still not working. i also tried
    .SetMotorSpeeds(0,0)
    but yet again, not working...
    It seem like i can't change the value of the motor speeds because i also tried with:
    Code (CSharp):
    1. Gamepad.all[i].SetMotorSpeeds(0.1f, 0.1f);
    2. Gamepad.all[i].SetMotorSpeeds(1,1);
    And it's vibrating very lightly.

    Edit: This only happens with the DualShock 4 controller (works fine with the XBox One controller)
     
    Last edited: May 12, 2022
  6. greenpixel16

    greenpixel16

    Joined:
    May 1, 2020
    Posts:
    1
    I am from 11 years in the future. I'm stumbling upon this bug in unity 2022.3 and this is the only thing I could find regarding this issue! Any idea why controller rumble (using Gamepad.current.SetMotorSpeeds) still doesn't stop when play mode is off in the new input system?