October 21, 2014 (is there a way to auto-timestamp posts here…?)

So this is going to mostly be a Unity3d/Unreal4/Oculus Rift/Game Development thing, but my first post is not about any of those things. Instead, it’s about the Leap Motion input device, and some of the technical glitches I’ve encountered getting it to work. It’s pretty cool when it works, but it can take some doing. This post might sound like complaining, but I assure you - it’s not. I just want to get all this out there, in case anyone else encounters the same problems and doesn’t find solutions anywhere else. I didn’t.

First and foremost, Leap Motion is built for Unity Pro, and working in Unity Free is a bit of a hassle. That said, I have gotten pretty good results once the Free project has been set up and tweaked a bit. There is a guide on their site for setting up a Unity Project in Unity Free. I’ve found that the fastest way to success is to download an existing Leap project from their website, and just create an empty scene. Make sure you don’t download the Pro version if you don’t have Unity Pro.

Image Passthrough is where you can see what the Leap Motion cameras see, and I had some issues with Unity Free. Just loading up Unity gave me some shader errors in the console. The demo scenes would run, but anything that worked with Passthrough would just show a gray screen. I learned a bit about shaders, and Googled the hell out of the problem. It turns out there’s a problem with branching code in DirectX9. If you’re running into an error on the shader ‘LeapMotion/LeapUndistorted’, you just need to comment out a couple of lines to get it working:

//if (texImageX > 1 || texImageX < 0 || texImageY > 1 || texImageY < 0 )

//return float4(0, 0, 0, 0);

You should find that around line 58. Just comment the two lines, and you should be fine. Also, make sure you “Allow Images” in the Leap Controller Settings.

You should really restart your computer before and after installing, or after uninstalling. I found this out the hard way. I leave my computer on for days at a time, so it was tough to figure out. I turned on my computer one day, and Leap Motion was plugged in, but the icon in the system tray was black instead of green. Mouseover said “The Leap Service is not running, you may need to start it manually.” Resume Tracking did nothing. So I googled.

I attempted to Stop and Start the service in Task Manager’s Services window, to no avail. It said I didn’t have the privileges to do that, even though I’m the only account on my computer. I made sure the Leap controller wasn’t running or anything, still wouldn’t Start. So I googled some more, and found a neat thing I could do in Command Prompt. So I ran the command prompt with Admin privileges, typed “net stop LeapService”. The prompt hung for a while, and then told me “The service is not responding to the control function.” Well that’s helpful. I was basically paralyzed. So I reinstalled LeapMotion, and it worked. Until I restarted my computer.

Clearly, frustration was high at this point. I wanted to figure out the issue, so I uninstalled, and reinstalled. Just verified that Leap was working through the Visualizer, and then restarted the computer. The leap service would not start again, so I uninstalled. This time, I restarted the computer after the uninstall. There were no traces of LeapMotion anywhere on my computer. Installed it fresh, verified it was working, and restarted. GLORIOUS SUCCESS! This happens with both software updates through the Leap Controller app, and manually downloading the newest SDK from the site. Just beware, if your Leap stops working, and reinstalling works… it won’t work the next time you restart, and you’ll have to reinstall again.

All that said, now that I have Leap Motion working consistently, it’s getting to be kind of fun. There’s some weird stuff in the demos that I haven’t quite wrapped my head around yet, but I’ll let everyone know when I do.

Even with all these weird problems, I’d still say Leap is worth the money.