- Home /
Xbox 360 controller vibration in build?
I'm using XInput for vibration can't get the controller to vibrate for a windows executable build of game we're working on. I know the XInputInterface.dll file has to be in the root folder with the .exe file, but that doesn't help.
The code for detecting controller:
PlayerIndex testPlayerIndex = (PlayerIndex)i;
GamePadState testState = GamePad.GetState(testPlayerIndex);
if (testState.IsConnected)
{
connected = true;
playerIndex = testPlayerIndex;
playerIndexSet = true;
}
The problem seems to be that testState.IsConnected is never triggered; the build never detects that a controller is detected. I tried using Input.GetJoystickNames as well, but that never detects the controller either.
This all works like a charm in the editor, but doesn't work at all in the build (although the controller itself works fine with the game). What's wrong?
Answer by HarshitDave7 · Mar 22, 2018 at 01:31 PM
GamePad.SetVibration(playerindex,float,float); This should work,try GamePad.SetVibration(playerinder,float,float)