Advertisement

Connecting Games to External Devices

Started by March 28, 2018 01:36 AM
3 comments, last by swiftcoder 6 years, 5 months ago

When creating a game, particularly in Unity, is it possible to connect the game to an external device? I’m looking into ways to allow a device or devices to respond to player actions in-game, but I’ve had trouble finding sources on the subject. To help explain sort of what I’m looking into, an example of how I’d like to test out this idea is by having a physical LED light. That LED light would turn on in the real world when a player did a certain action. Is there any way to go about doing something like this?

Definitely possible :) From unity you might have to make some kind of native plugin that talks to your device though.

Objects In Space is a big inspiration here for me: check out the custom controllers that they support: http://objectsgame.com/the-controllers/arduino-tutorial/

IMG_1471.jpg

They're using a simple text-based serial protocol, but another option would be to use a library on an Arduino (or similar) to make it appear on your PC as a HID device when plugged in via USB. You could then talk to it like a regular Joystick/Gamepad over DirectInput (and use force feedback to send messages to your device).

Advertisement
12 minutes ago, Hodgman said:

Definitely possible :) From unity you might have to make some kind of native plugin that talks to your device though.

Objects In Space is a big inspiration here for me: check out the custom controllers that they support: http://objectsgame.com/the-controllers/arduino-tutorial/

IMG_1471.jpg

They're using a simple text-based serial protocol, but another option would be to use a library on an Arduino (or similar) to make it appear on your PC as a HID device when plugged in via USB. You could then talk to it like a regular Joystick/Gamepad over DirectInput (and use force feedback to send messages to your device).

Thank you! That looks super interesting, I’m definitely gonna have to check it out! 

The easiest way to hook unity up to external devices is just to setup a local webserver on one of the devices in question, and then handle it all via web requests. You can even wire it through a cloud backend if that's simpler.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

This topic is closed to new replies.

Advertisement