Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
jared_pinargote's avatar
7 years ago

How do you separate touch and xbox controllers?

I am trying to set up an asymmetrical VR prototype, but I want to use an Xbox controller to control the PC player and let the VR player use the touch controllers to move.

The problem is that the PC player uses the scripts from https://assetstore.unity.com/packages/templates/systems/3rd-person-controller-fly-mode-28647. This has been great, except that the line `Input.GetAxis();` gets both the touch controller's input as well as the Xbox controller's. I tried using a third party solution here: https://assetstore.unity.com/packages/tools/input-management/input-manager-cc-57332. From what I have seen through debugging, it seems like the touch controllers and the Xbox controller BOTH register as `Joystick 1`. 

The weirder thing is that the VR player only gets moved by the touch controllers, but the PC player gets moved by the touch controller ONLY with the left hand and ONLY in the Y axis! The Xbox controller works as expected, however.

How do I allow the VR player to move around with touch joysticks and PC player with a gamepad WITHOUT them influencing their non-corresponding player?