Let’s talk Unity. If you aren’t familiar with it, it’s a cross platform game engine with a powerful GUI editor and robust asset store. We also have support in our official Unity package.

Unity5<em>Editor</em>PhysicalShading<em>Doll</em>Editor

If you’ve never done Unity development, they have a bunch of great tutorials to help you get up to speed. I’m going to recommend their Roll-a-Ball series as a good one to complete, as you build everything yourself and it don’t rely on a bunch of pre-made assets. It’s also going to form the basis of our full Myo integration Unity tutorial, which will be coming soon.

What we’re here for today though is just to walk you through getting our Myo armband plugin integrated into a new or existing project. So lets get started.

Setup

  1. Download and install Unity if you don’t have it already
  2. Download and extract the Myo Windows or Mac SDK somewhere safe
  3. Open a new (or existing) Unity project
  4. Go to Assets ->Import Package -> Custom Package

    Custom Package

  5. Navigate to where you extracted the Myo SDK and select MyoUnity.unitypackage

    Import Package

  6. Import everything. The Myo Samples script is useful, but not essential. You can skip it next time if you like

    Package Contents

If you have Unity Pro, you’re all set up. If you are using the free version, we have a bit more work to do, and it’s unfortunately the most complicated part.

Extra Unity Free Steps

The basic gist of what we’re going to do is take the myo.dll that’s in the plugins/x86 folder, drop it into your main project folder, and delete the Plugins folder. Follow these steps:

  1. In your Project View in Unity, open Assets -> Plugins -> x86. Right click on Myo and select “Show in Explorer”

    Project view

  2. Copy myo.dll

  3. Navigate up to your root project folder (the one that contains Assets, not assets itself)
  4. Paste myo.dll

    Paste myo dll

  5. Go back into Assets and delete the Plugins folder (unless you are also doing Oculus Rift integration, then just delete all of the myo-specific files)

You’re done! From there, you just drag a Myo Hub prefab (either one or two Myos, depending on what you want to do) onto your scene and connect it up. You’ll also need to make sure when you export your project that myo.dll is included in the same directory as the executable.

Next Steps

Take a look at the Myo Samples -> Box On A Stick scene to see a quick example of the Myo armband working in Unity. It shows how to set up a rotates a joint based on the orientation of the armband (and has a nice JointOrientation script you can just use) as well as how to detect and use hand poses.

Questions? Let me know here, on Twitter (@thalmicdev), or on the Developer Forums!

Stay tuned for our next tutorial series where we’ll do a deep dive on using Myo armbands in Unity! And by “stay tuned”, I mean subscribe to this blog and also our newsletter. We’ve got a lot of great content in the pipeline.

Good luck, and happy coding!

Newsletter

Enter your email address and get all latest content delivered to your inbox every now and then.