Search code examples
c#unity-game-engineinputplaystation3

Getting PS3 controller input in Unity3D


I want my PS3 controller to control my unity game, and so far it isn't going well. I have it plugged into my computer via the USB cable it came with. My computer did not install any drivers when I plugged it in, but it did make a sound and Unity seems to have detected it, printing Joystick Connected (controller name here)

Unfortunately, beyond that the controller does absolutely nothing. I have gone to the input menu and have adjusted input according to this map: http://forum.unity3d.com/threads/ps3-button-map.89288/ enter image description here

but still get nothing. Not a single button does anything.

I should also mention if this helps, this is how I'm getting input:

void FixedUpdate()
{
    float movehorizontal = Input.GetAxis("Horizontal");
    float movevertical = Input.GetAxis("Vertical");
    Vector3 movement = new Vector3(movehorizontal, 0, movevertical);
    rb.AddForce(movement * speed);
}

Solution

  • You need a special driver in order to get your PS3 controller to work on PC. I highly recommend ScpToolkit. It's the best one out there.