- Home /
How to set vibrate/rumble on PS3 controller in Unity 5.1
I am having some major difficulty in trying to figure out what I am doing wrong. I am busy creating a small project and would love to use this function in my game.
I have followed this to the T: http://answers.unity3d.com/questions/375119/how-to-make-the-playstation-3-controller-vibrate.html Except (and maybe I'm misunderstanding what he is saying) is to add the XInput files from MotionInJoy to my Unity project folder. Where do I find this?
I want the console to vibrate on trigger. I have added my cube, box collider and ticked 'is trigger', linked my javascript file:
function Update () {
var left = 0;
var right = 0;
if(Input.GetButton("Fire1"))
left = 1;
if(Input.GetButton("Fire2"))
right = 1;
XInputDotNetPure.GamePad.SetVibration(0, left, right);
}
I have also used his C# code example to link the XInput to my console: http://answers.unity3d.com/questions/218084/xinput-how-do-i-access-vibration-on-360-controller.html
At the moment, there is no rumble / vibration of any sorts.
I am so stuck, any suggestions would be appreciated!