Leap Motion example project

Aim: build a game where the player can use the leap motion hand tracking to hit some blocks of a platform

What is leap motion?

“The leap motion controller is an interactive tool used for gesture recognition and movement in various fields like medicine, manufacturing, 3D modeling etc. It uses cameras and infrared LEDs to track the movement of the hand.
https://www.sciencedirect.com/science/article/pii/S1877050918307403

No tutorial was needed because the unity package for ultraleap was a package that comes with a bunch of predefined objects and scripts to utilise the hand tracking.

https://docs.ultraleap.com/unity-api/The-Basics/getting-started.html

Objects in the game:
– ContactCounter
The main script used in the example “Playerscript” is used to process the cube tag on the cube to increment the score
– Cube
Tag attached to the cube object named “cube” which is utilised to tell unity that this object is the object to process when it hits the contact counter. The cubes implemented were part of the Ultraleap package
– Hands
Some Preset hands that are in the ultra leap asset package to show where the players hands as they are tracked
– UI
The UI has two things in it, a counter for the player to know how many cubes that have been scored when they are knocked off

Player script

The player script has some simple functions in it, it communicates with the count text in the game so when a cube contacts the contact counter object it will increment a score of 1 and when it reaches 6 is will display some UI text telling the player that it has won. After the cube touches the counter, the collision of the cube to the counter is processed and destroys the cube.

Example of the game working:

Many Thanks,

James Lacey

Leave a comment

Blog at WordPress.com.

Up ↑

Design a site like this with WordPress.com
Get started