- Home /
Question by
JannickL · Jul 20, 2017 at 03:43 PM ·
controllerxboxxboxcontrollerxbox controllercross-platform
Xbox controller double input (right stick axis)
Hello there, i'm trying to get input of two xbox controllers. Every button works fine because of the positive button field (joystick X button 1).
Unfortunately the right stick is an axis and unity does not offer the positive button field for axis. However, when i move the right stick on first controller for player one -> player two receives the input too.
How can i avoid this? I haven't found any ID's for the controllers.
Thank you
Snippet:
private void Update() {
// This code is included in a script that is assigned to a camera (Got two camera in scene, so the code get's called twice)
currentX += CrossPlatformInputManager.GetAxis("Horizontal_P" + myPlayer.playerId + "_R");
currentY += CrossPlatformInputManager.GetAxis("Vertical_P" + myPlayer.playerId + "_R");
}
Comment