This week, I want to share with you, my Star Wars Lightsaber project.
I’ve implemented it on May 4th to celebrate the Star Wars day. It’s a simple Unity project where you can control a 3d Star Wars lightsaber using a Leap Motion.
Star Wars Lightsaber 3d Model
First, I’ve used Blender to create a 3d model based on the Anakin’s lightsaber. It’s not very detailed, doesn’t have textures but it gets the job done.
Unity Core Assets
It provides a utility hand model with quick access to the several parts of the hand (more…).
I’ve used it to add an empty gameObject to the Right Hand Palm. It works as the parent object for the lightsaber when the player is holding it. IMAGE1
In this Module, there are Detectors and Detector Logic Gates (more…). A Detector helps identify several hand and finger positions. A Detector Logic Gate combines individual detectors and returns the global result.
Detector Logic Gates
- Used to grab the lightsaber;
- Combines the Palm Forward with the Extended Fingers;
- Used to switch on/off the lightsaber;
- Uses the Not Extended Fingers Detector (I don’t remember why I used a logic gate while a single detector was enough);
- Used to release the lightsaber;
- Combines the Palm Down with the Extended Fingers;
I’ve only used the Rigged Hands prefab (more…).
- Implements the Grab, Enable and Release actions;
- Controls the lightsaber light animation (particle system and scale);
- Controls the lightsaber sounds.
Don’t forget to check the complete project on GitHub.
Happy Coding 🙂