I have a bluetooth controller for my android phone (specifically the VR Park controller) and I want to use this for a VR game on my android phone. Does anyone know how I would take the joystick input from this? I have played other unity games which used it such as Hardecode VR so I know it can be done, I just don’t know how I would get the input from the controller joystick to make the player move.
Gosh darned thing ate my reply (actually it may be in a moderation queue, so apologies for double posting if that’s the case).
I’m trying to do this right now. I have the stick working OK. By default the VR Park is in pointer mode. Hold “@” and press “c” to go to what the instruction video calls “VR” mode. In this mode the stick produces the correct up, down, left and right events to control the FPSCharacterController script. The top trigger button also seems to press “space” which means jump works.
What I can’t figure out is what the lower trigger button does. In android it seems to press back, but KeyCode.Escape doesn’t seem to evaluate to whatever it’s sending, if indeed it sends anything at all.
Do let me know if you get any further than I have. I’m quite keen to get this working.
Edit: I got it! If you put it in mode “B” (press “@” and “B”) the lower trigger becomes “Fire1” (It’s possible that the keycode it produces is actually either left ctrl or mouse 0, “Fire1” being the input button that triggered and those being what I had set to that button).
Good luck!
Edit: One more thing, I have to have mobile input turned OFF to get this bugger to work. No idea why, but I can’t get it to work at all with mobile input turned on.
@Allwood_Game_Dev … I purchased ReWired (Guavaman Enterprises | Rewired) as a controller solution for my games. Once you create your base mappings and re-wire your game the rest is easy.
If you are on a budget and can’t purchase a solution then I would start with the Bluetooth controller manufacturer. They usually offer SDKs for the various development platforms that should get you up and running quickly.
Note also that the VR aspect of your game really has nothing to do with control input aspect … so the same applies to to non-VR games as well.
hi everyone, I connect the bluetooth joystick as the answer said, it works, but I have a little problem, when I see to north, if I want to go forward, I just put the joystick up and It works, but when I turn my head to see west (for example), if I want to go forward I have to put joystick left, because if I put joystick up, my character goes to my right not forward, does anyone know why? how can I fix it?, thanks to all to read this
@daveleack
Hi from France daveleack, thanks a lot for your post.
I’ve follow your tips but I cant move the camera with the joystick.
Ive got the same bt controller as you.
On editor mode, keyboard works well for moving the character, did you used special settings in the input manager?
Have u got an idea ? Thanks
So a heads up. If anyone has downloaded the new 1.24 Realistic FPS prefab. it seem to work much better in Unity/vr and I can actually build to the Gear VR device and sort walk around. The button mapping is still wonky and I’m going to try the above fixes and see if it cleans it up. I get nothing out of the unity input manager and the right joystick still maps as (move joystick up to turn right, move joystick down to turn left. ) But it works now, where before it didn’t so progress!!!
Thank you @daveleack for the answer!
My steps:
1.I’ve ordered a VR BOX from China and it came with this controller ($10).
2.Put some batteries into it
3.Connected to a Samsung S7 bluetooth
4.I’ve downloaded the free asset “Controller Tester” and tried the VR BOX bluetooth remote control with it.
5.First it behaved totally limited, just reacting to 3-4 controls. Then however I’ve read you answer and pressed @ and C together and all controllers work logically now.
Interesingly both the iOS and Android mode works well on a Samsung S7 device.
Hi everyone I have tried several ways of input button and I’m on the (@ + B) position of the VR park Controller for android and not getting anything.
here is my 2 current methods I"m using for the buttons to display a message to me on screen via UI
public void FireButton2()
{
if (Input.GetKeyDown(KeyCode.Joystick1Button5)) //Pressing R Button
{
canvas.gameObject.SetActive(true);
fire2Text.gameObject.SetActive(true);
print("" + fire2Text);
}
}
public void L1ButtonPress()
{
if (Input.GetMouseButtonDown(0)) //trying to use Mousebuttondown to get l1 on VR parkController
{
canvas.gameObject.SetActive(true);
l1Text.gameObject.SetActive(true);
print("" + l1Text);
}
}