Custom Pointer
Custom Pointer
Custom Pointer is available on the Unity Asset Store.
The Custom Pointer asset allows one to turn any Transform or Leap Motion finger into a pointer that can interact with the UI. This works with 3D Transforms and Rect Transforms by using their screen position. Although you can make your custom pointer click by whatever means you like, hover-click is a built-in feature that shows a progress bar that indicates time-till-click, similar to those found in Kinect games, and the hover-drag feature works similarly.
In addition to allowing any Transform to become a pointer, this asset includes classes that work specifically with the Leap Motion, both Core Assets and the new Orion Beta v4.0.2. Scenes using Unity’s 4.6+ UI will allow a Leap Motion hand to click using hover click, screen tap, or key tap without any changes to the UI.
Clicking works! #leapmotion #unity3d 4.6 #gamedev https://t.co/P5BjDTkwn4
— Shane Celis (@shanecelis) January 26, 2015
Note
Leap Motion Orion is still in beta and is changing rapidly. Custom Pointer supports Leap Motion Orion v4.0.2. There does appear to be an issue that can be seen in “Custom Pointer Leap Motion Orion Demo.” RegisterHandTransition is not always called faithfully so far as I can tell. This often leads to the first time the hand is shown, it won’t have a working pointer. If you remove your hand from the sensor, and put it back in, it will work. I believe this issue will be fixed by Leap Motion in subsequent releases of their software.
Scenes
The following scenes demonstrate what Custom Pointer can do for you.
0. Menu 3D
This scene is from Unity Sample: UI. It is essentially unmodified. You can use your mouse or keyboard to interact with it. Custom Pointer is not enabled. Its purpose is to show that an unmodified UI may be used with a variety of pointers that Custom Pointer supports.
1. Menu 3D Cube Pointer
This scene uses a spinning 3D cube as a pointer. It can click by hovering or pressing space bar. This scene demonstrates that any Transform may be used as a pointer.
2. Menu 3D 2D Character Pointer
This scene uses a 2D game character as a pointer. Move the character using the arrow keys and space bar to jump. Move the character over a button to hover click it. This demonstrates how you might add some novelty to your menu.
3. Menu 3D Leap Motion Without Custom Pointer
This is nearly identical to scene 0; however, a Leap Motion controller has been added. If you have a Leap Motion, you will see your hand, but your hand will not be able to interact with the menu. This is the basic state of Unity UI and Leap Motion interaction currently without Custom Pointer. This scene only works with Leap Motion Core Assets.
4. Menu 3D Leap Motion With Custom Pointer
Same scene as 1 except Custom Pointer support has been added. Now the Leap Motion hand can interact with the UI using hover click and hover drag. This scene only works with Leap Motion Core Assets.
5. Menu 3D Leap Motion Orion Without Custom Pointer
This scene is the same as 1 but modified for Leap Motion Orion beta software. The hands work but can’t interact with the GUI. This scene only works with Leap Motion Orion beta.
6. Menu 3D Leap Motion Orion With Custom Pointer
This scene is the same as 2 but modified for Leap Motion Orion beta software. The hands can now interact with the GUI thanks to Custom Pointer. This scene only works with Leap Motion Orion beta.
Future Plans
I hope to implement support for the Google Cardboard soon and the Oculus Rift as soon as I have access to the equipment. Thank you for your time and support!
Custom Pointer is available on the Unity Asset Store.