Button input from Bluetooth controller

Hi guys,

I’m currently working on a project for school that requieres us to use a bluetooth controller with a third party headset for smartphone. I’m stuck on the main menu because i’m not able to click on the buttons with the remote. I’m pretty new to Unity and to C# and it’s been a week of trials and researchs on the web that lead to nothing. So I hope you folks could at least tell me if it’s even possible or not.

Notes: I’m working with the Android SDK, Google VR SDK and the phone we are using is a Huawei P10. The version of Unity is 2019.1.0f2 Personnal.

Thanks in advance.

If the bluetooth controller is properly paired with the phone, you should be able to read its inputs using the Input class. Is that what you’re trying to do?

Yes. I know i can get them with the Input.GetButton() method, but I want to click on the button with the input from the controller. (Ex: I select the button via the Reticle and click on it with one button from the controller.)

I just don’t know how to bind the controller’s inputs with the GvrPointerInputModule.

Hmm, I don’t use GvrPointerInputModule, so I can’t say specifically how to do that. Most event systems look for a “Submit” button, which you would define in the Input Manager settings. Make sure you have one of those, and that it’s bound to the same button you can get with Input.GetButton().

I managed to setup all of the controller’s input in the input manager, but it doesn’t seems to work at all. Weird enough, if I touch the screen when the button is highlighted(the VR Reticle is on the button), it is considered like a click. Is there a way to mimic a touchscreen input via C# script?

Not that I know of. I think you need to double-check all your input manager and event system settings. Somehow the button you’re thinking is a Submit button, does not appear so to the event system.