Unity Vibration

I was having trouble getting unity vibration to work correctly looking so far ive tried
Gamepad.current.SetMotorSpeeds(x, y)
but it always throughs a “The name ‘Gamepad’ does not exist in the current context” error.
i don’t know if this is relevant but I am using a xbox one wireless controller

Two likely reasons come to me:

  • Unity’s new input system isn’t in a project by default. To add it go to Window → Package Manager, select the “Unity Registry” package category, and add “Input System”.
  • You may be missing the appropriate using statement: using UnityEngine.InputSystem;

Thanks, the solution seems to work but only if my controller is plugged in directly into my computer, if I’m using bluetooth/wireless it doesn’t seem to work.
Know any solutions?