Google Daydream Controller Emulator with UE4

Has anyone managed to get the Google Daydream Controller Emulator working with UE4 and Android apps? The UE4 Android app’s Daydream settings activity looks fine and other non-unreal apps work with the controller emulator but apps built with UE4 never connect to the controller emulator. Any suggestions?

Could you elaborate on what do you mean by “UE4 Android app’s Daydream settings activity?” I’m also trying to get the controller emulator to work without any luck. I’ll let you know if I get anywhere…

Also would like to know - haven’t really found it documented anywhere yet :frowning:

Okay, I made a little progress here. I don’t know why this isn’t documented (or maybe I just missed it) but got to Edit -> Plugins -> Input Devices and enable “Google VR Motion Controller.” This requires a restart. Don’t forget to follow these instructions as well: https://docs.unrealengine.com/latest/INT/Platforms/GoogleVR/index.html

Once you have the motion controller setup for the player pawn you can use the following inputs in the Blueprint Event Graph:
MotionController Thumbstick: for main (thumbstick) click event
MotionController Thumbstick X: for left/right values on tumbstick
MotionController Thumbstick Y: for up/down values on thumbstick
MotionController Shoulder: for secondary button click

I will try to give more detailed instructions when I get a chance.

With these steps can you test the emulator controller inside of unreal viewport ?

With these steps can you test the emulator controller inside of unreal viewport ?

“waiting for connect” on control phone, How can I connect it to UE4?

What version of the controller emulator do you have? Google recently added Bluetooth support, and that’s the only version I could get to work. You need at least 1.4.01 according to this: Daydream Hardware  |  Google VR  |  Google for Developers

Let me know if this helps. Also, sorry for the dumb question, but you are connecting it to Nexus 6P and not the desktop editor right? Unity allows the controller to work inside the editor, which is nice, but Epic doesn’t support that yet, afaik.

So sorry I didn’t see this before. Unfortunately, I have been unable to get the viewport to detect the controller. It works in Unity 5, so it should be possible in Unreal, but Epic doesn’t support it yet, afaik. I hope they add support…

Thanks for reply. The version I used is connect by wifi, and can connect to Glalaxy S7(as the headset phone) and work well. I just wonder if the controller emulator can connect to PC and work inside the editor, You have given me the answer. It will be very good if Epic team support this function.

Adding info about DayDream controller inputs… Here is the full input mapping from within the UE4 GoogleVR Controller plugin.

Note that the same settings are mapped for both hands, so whether you set the option in the details of the standard Motion Controller Component to “Left” or “Right” will determine which hand you should call input events from… but either should work as long as you’re consistently referencing the same one.

(Conceivably this means Unreal could process input from two DayDream controllers – one for each hand – but I don’t know if the DayDream system can actually link with more than one at a time.)

// Setup button mappings
Buttons(int32)EControllerHand::Left][EGoogleVRControllerButton::ApplicationMenu] = FGamepadKeyNames::MotionController_Left_Shoulder;
Buttons(int32)EControllerHand::Right][EGoogleVRControllerButton::ApplicationMenu] = FGamepadKeyNames::MotionController_Right_Shoulder;

Buttons(int32)EControllerHand::Left][EGoogleVRControllerButton::TouchPadLeft] = FGamepadKeyNames::MotionController_Left_FaceButton4;
Buttons(int32)EControllerHand::Right][EGoogleVRControllerButton::TouchPadLeft] = FGamepadKeyNames::MotionController_Right_FaceButton4;
Buttons(int32)EControllerHand::Left][EGoogleVRControllerButton::TouchPadUp] = FGamepadKeyNames::MotionController_Left_FaceButton1;
Buttons(int32)EControllerHand::Right][EGoogleVRControllerButton::TouchPadUp] = FGamepadKeyNames::MotionController_Right_FaceButton1;
Buttons(int32)EControllerHand::Left][EGoogleVRControllerButton::TouchPadRight] = FGamepadKeyNames::MotionController_Left_FaceButton2;
Buttons(int32)EControllerHand::Right][EGoogleVRControllerButton::TouchPadRight] = FGamepadKeyNames::MotionController_Right_FaceButton2;
Buttons(int32)EControllerHand::Left][EGoogleVRControllerButton::TouchPadDown] = FGamepadKeyNames::MotionController_Left_FaceButton3;
Buttons(int32)EControllerHand::Right][EGoogleVRControllerButton::TouchPadDown] = FGamepadKeyNames::MotionController_Right_FaceButton3;

Buttons(int32)EControllerHand::Left][EGoogleVRControllerButton::System] = FGamepadKeyNames::FGamepadKeyNames::SpecialLeft;
Buttons(int32)EControllerHand::Right][EGoogleVRControllerButton::System] = FGamepadKeyNames::FGamepadKeyNames::SpecialRight;

Buttons(int32)EControllerHand::Left][EGoogleVRControllerButton::TriggerPress] = FGamepadKeyNames::MotionController_Left_Trigger;
Buttons(int32)EControllerHand::Right][EGoogleVRControllerButton::TriggerPress] = FGamepadKeyNames::MotionController_Right_Trigger;

Buttons(int32)EControllerHand::Left][EGoogleVRControllerButton::Grip] = FGamepadKeyNames::MotionController_Left_Grip1;
Buttons(int32)EControllerHand::Right][EGoogleVRControllerButton::Grip] = FGamepadKeyNames::MotionController_Right_Grip1;

Buttons(int32)EControllerHand::Left][EGoogleVRControllerButton::TouchPadPress] = FGamepadKeyNames::MotionController_Left_Thumbstick;
Buttons(int32)EControllerHand::Right][EGoogleVRControllerButton::TouchPadPress] = FGamepadKeyNames::MotionController_Right_Thumbstick;

Buttons(int32)EControllerHand::Left][EGoogleVRControllerButton::TouchPadTouch] = GoogleVRControllerKeyNames::Touch0;
Buttons(int32)EControllerHand::Right][EGoogleVRControllerButton::TouchPadTouch] = GoogleVRControllerKeyNames::Touch0;

Hey all, does anyone know if its possible to connect controller emulator inside UE viewport yet, perhaps version 4.14? This would be a huge help in testing turn around times!

according to this you can: https://developers.google.com/vr/unreal/daydream-in-unreal - not tried it myself though

Wow, it was a hell of a lot easier than I thought. Just linked all the latest NDK’s, SDK etc etc, plugged 6P in, and made sure emulator open and it worked! Thanks UE once again.

Hey (or anyone else here) are you also seeing this problem with the controller direction emulating in the editor?: Daydream motion controller orientation problem 4.14P2 - XR Development - Epic Developer Community Forums