Sunday, August 17, 2014

Using Leap with the Free version of Unity 3d

When I started trying to play with Leap and Unity, I found that the asset package for Leap on Unity's online store had a version that required Unity Pro. The error you get when trying out the tutorial on Leap's Youtube video (embedded below) when using free Unity is that when you try to play with Leap's Hand Controllers on , you get something to the effect of "This plugin requires Unity Pro."


Now, Leap's website clearly states that a package for free Unity existed (which is what I downloaded.) Unfortunately, there did not seem to be any asset bundle in that zip file. So there wasn't a clear way to import the contents of that package into Unity. That left me rather confused, as I was new to Unity and still a relative Leap newbie.

After Googling for the solution it appears that the Leap Devs had documented this but did not make it very accessible. The instructions are here:

https://developer.leapmotion.com/getting-started/unity/free

There are some minor sources of confusion in the instructions however. The instructions were for the context of taking their Unity examples, and modifying them so they would work for free Unity. I was starting from a Unity project from scratch using the Youtube tutorial above. Their instructions for starting from scratch were based only on Windows folder structure. For the Mac, the files libLeap.dylib and libLeapCSharp.dylib were found in the LeapSDK/lib folder instead. This instruction probably was not completely necessary, as the subsequent commandline instructions on the same page showed how to get those files from deeper in the Unity project's folder structure not previously documented.

In any event, I got my Leap device integrated with the free version of Unity rather quickly after that. Here is a screenshot of me playing with a bouncing ball, a bouncing cube, and a gravity-tied box I could pick up and throw inside Leap's prefab bounding box. You need to get the camera within the box, as well as the directional light source. The above Youtube video covers instructions for setting the properties of some of the objects.


Some initial experiences - the hand control seemed clunky, and the lack of stereo vision on the 2D screen meant I had some difficulty reaching out to the right depth. The fingers of the default hand avatars had a lot of difficulty gripping stuff, even though the small block was supposed to be made of "rubber". It is not certain to me if my Leap hardware is old or not as good as it should be. Of course, with regard to grip and all other aspects of Unity interface, I am sure it is down to getting the physics configured just right or building a new hand model that works better than Leap's prefab hand. One thing the interface is pretty good at is bouncing a free floating ball inside an enclosed box, especially if one makes a fist.

No comments:

Post a Comment