Lean Touch
Lean Touch is a tool for creating touch based interactions. This package is installed by default in the Genies Dev Kit and is ready to use.
Here are some popular use cases:
- Dragging an object with your finger
- Rotating the object by twisting two fingers
- Scaling an object by pinching two fingers
Read Lean Touch's documentation for more information.
Lean Touch Components
Lean Touch tools are accessible by adding components to GameObjects that require interaction.
You also must have a GameObject with a Lean Touch component in your scene for any Lean Touch component to work.
There are 3 methods to adding a Lean Touch component:
- From your menu bar, select GameObject > Lean > Touch.
- Right click inside the Hierarchy window, and go to Lean > Touch.
- Create a new GameObject, and add the component Lean Touch.
Example using Lean Touch
This example will show how to move a cube by dragging the pointer using the Lean Touch tools.
Add Lean Touch
Start by adding the Lean Touch component to a GameObject in your scene.
Add Simulator
In the Inspector window for the Lean Touch component, press the Add Simulator button. A Lean Touch Simulator component will allow Lean Touches to affect the Unity scene's objects directly.
Add a Cube
Now add a cube to the scene such that it is visible in the screen. Then add a Lean Drag Translate component to the cube GameObject.
Test the Project
Press Play and you should be able to drag the cube around the scene.