North (formerly Thalmic Labs), the creator of the Myo armband, was acquired by Google in June 2020. Myo sales ended in October 2018 and Myo software, hardware and SDKs are no longer available or supported. Learn more.
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.
- Download and install Unity if you don’t have it already
- Download and extract the Myo Windows or Mac SDK somewhere safe
- Open a new (or existing) Unity project
- Go to Assets ->Import Package -> Custom Package
- Navigate to where you extracted the Myo SDK and select MyoUnity.unitypackage
- Import everything. The Myo Samples script is useful, but not essential. You can skip it next time if you like
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:
- In your Project View in Unity, open Assets -> Plugins -> x86. Right click on Myo and select “Show in Explorer”
- Copy myo.dll
- Navigate up to your root project folder (the one that contains Assets, not assets itself)
- Paste myo.dll
- 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.
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.
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!