Skip to main content

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
tip

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:

  1. From your menu bar, select GameObject > Lean > Touch.
  2. Right click inside the Hierarchy window, and go to Lean > Touch.
  3. Create a new GameObject, and add the component Lean Touch.

Lean Components

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 Lean

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.

Simulator Component

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.

Lean Drag

Test the Project

Press Play and you should be able to drag the cube around the scene.

Drag Cube

TypeScript Usage

danger

The Lean Touch API is currently not available in the Dev Kit.