I have a VR game idea which is being built on Unity with external hardware (Arduino, Gyroscopes, etc).

I have thought of ways to connect the Arduino to Unity but what I am now struggling with is thinking of a way to play the VR game. I've created VR games before for iOS where the user can use Google Cardboard, however, I feel like that would not be possible due to the external hardware.

Are there any other ways that you know are possible?

  • 2
    \$\begingroup\$ Sorry, what is the issue again? \$\endgroup\$
    – Vaillancourt
    Aug 9 '19 at 2:12
  • \$\begingroup\$ @AlexandreVaillancourt What platform can the VR game be released on so it can use the external hardware? Like google VR requires a smartphone and connecting a smartphone to the external hardware does not seem feasible to me. \$\endgroup\$ Aug 9 '19 at 2:17
  • \$\begingroup\$ Let's do away with "seeming* — Concretely, what would prevent you from making this connection? \$\endgroup\$
    – DMGregory
    Aug 9 '19 at 2:27
  • \$\begingroup\$ @DMGregory Would there not be latency issues with the external hardware being connected via bluetooth? The external hardware is a gyroscope which sends data to the arduino and then more data is being sent to the mobile device? \$\endgroup\$ Aug 9 '19 at 2:34
  • 1
    \$\begingroup\$ Sounds like something you can test, measure, and report back. You have your custom hardware and we don't, so this is in your court to answer. \$\endgroup\$
    – DMGregory
    Aug 9 '19 at 2:36

This is actually a very common scenario, it may be less recognizable because you have custom hardware. The more commonly recognized scenario is a wireless input controller, like an XBox controller. An XBox controller sends and receives data. It tells an application that a button is being pressed, and an application tells it to vibrate.

Your custom hardware talks to your application via some defined data standard, like serialized JSON data. This enables them to send data back and forth, respond to commands, provide input, etc.

The medium for that data is dependent on your platform, it could be WiFi or Bluetooth or USB. The medium you use will dictate the connection process and how transparent that process is to the user.

Since this is your application, with your custom hardware, the decisions about what will work best are up to you as the developer. Just know that you'll need to decide on a data format and a medium (or you can support multiple mediums if you're feeling ambitious).

As an example. I worked on a project for the HoloLens that communicated with a Raspberry Pi. The Pi application hosted a web server, which exposed various endpoints for collecting data and receiving commands. It also broadcast itself as a host on the WiFi network it was connected to. The HoloLens would then connect to the same WiFi network, and the HoloLens application would listen for host broadcasts, and connect. Then the HoloLens app would show a Mixed Reality interface to read data from and control various bits of hardware that were attached to the Pi. The HoloLens application also had an alignment phase, allowing you to align to the Pi. This enabled the holograms to be appropriately placed over the components they were getting data from or sending commands to.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.