Lean Touch+ is an extension to Lean Touch, adding many new demo scenes, and many new components.
The new components are also designed to be very flexible, so you can combine them in any way you like.
Simply go through all the demo scenes in the Touch+/Examples folder!
Most of the demo scenes introduce one new feature at a time, allowing you to clearly understand what is being done.
The description text at the bottom also tells you in detail which components or settings were added/changed to achieve the effects seen.
If you feel like any feature isn't explained well enough, or that a feature is missing, then let me know so I can improve this asset!
This is a list of the in-game example scenes and a description of what it shows.
This shows you how to detect when your finger has been touching the screen for more than 1 second without moving. This is done using the LeanFingerHeld component, which invokes events when this happens, and when you later stop touching the screen, or move your finger too much. You can modify this component's MinimumAge and MaximumMovement settings to change how it behaves.
This shows you how to make a first person camera that can look around when you drag the screen.
This shows you how to perform an action using a single or double tap, without them interfering with each other. This is done using the LeanFingerTapExpired component, which executes when your tapping finger has stopped tapping for long enough that the tap counter has been reset. You can adjusting this timing with the LeanTouch.TapThreshold setting.
This shows you how to perform an action using a single or double tap, without them interfering with each other. This is done using the LeanFingerTapExpired component, which executes when your tapping finger has stopped tapping for long enough that the tap counter has been reset. You can adjusting this timing with the LeanTouch.TapThreshold setting.
This shows you how to perform an action using a single or double tap, without them interfering with each other. This is done using the LeanFingerTapExpired component, which executes when your tapping finger has stopped tapping for long enough that the tap counter has been reset. You can adjusting this timing with the LeanTouch.TapThreshold setting.
This shows you how to detect the multi twist gesture using the LeanMultiTwist component. This component's OnTwistDegrees event is connected to the LeanRoll.DecrementAngle method, which allows you to change the rotation of the arrow.
This shows you how the MultiTwist demo scene can be modified to work with a one finger twist gesture. This is done by changing the OneFinger setting to ScreenCenter or FingerStart.
This shows you how the MultiTwist demo scene can be modified to work with a one finger twist gesture. This is done by changing the OneFinger setting to ScreenCenter or FingerStart.
This shows you how to rotate an object with a delay. This is useful if you need very precise positioning on a touch device, because when you release your finger typically your finger can move slightly and unexpectedly add some movement. This is done using the LeanDelatedValue component, where the LeanMultiTwist.OnTwistDegrees event is connected to the LeanDelayedValue.SetX method, which after a delay invokes the LeanDelayedValue.OnValueX method, which is connected to the LeanManualRotate.RotateA method.
This shows you how LeanMultiTap can be used to detect a multi finger tap gesture,
This shows you how LeanDragTranslateRigidbody can be used to translate a Rigidbody GameObject.
This shows you how to combine Select3D and DragToThrowTarget, allowing you to throw objects around the screen with force indicators.
This shows you how LeanDragTranslateRigidbody2D can be used to translate a Rigidbody2D GameObject.
This shows you how LeanDragTranslateRigidbody2D can be used to translate a Rigidbody2D GameObject.
This shows you how to detect when the first finger begins touching the screen, and when the last finger finishes touching the screen. This is done using the LeanFirstDown and LeanLastUp component.s
This shows you how to detect when your finger has been touching the screen for more than 1 second without moving. This is done using the LeanFingerHeld component, which invokes events when this happens, and when you later stop touching the screen, or move your finger too much. You can modify this component's MinimumAge and MaximumMovement settings to change how it behaves.
This shows you how LeanTranslateRigidbodySmooth can be combined with LeanSelectableDragTorque to pick up, spin, and throw Rigidbody GameObjects.
This shows you how LeanSelectablePressureScale can scale the current selectable based on the pressure of the selecting finger.
This shows you how LeanRecordFinger can record the movement of the last finger, and replay it when pressing a button.
This shows you how the LinePowerThrow2D demo scene can be modified to work like a slingshot game. The sphere's Rigidbody2D is marked as kinematic to stop it from moving, and when released the LeanDragLine.OnReleasedDelta event maked it dynamic, disables the LeanSelect component, and finally applies velocity. The LeanDragLine.Invert setting is also used to invert the power indicator.
This shows you how LeanMatchBlock can implement an input system similar to match-3 style games.
This shows you how the Select3DTransformRelative demo scene can be modified to revert the transform values when you deselect an object. This is done using the LeanRevertTransform component. The reversion is triggered using the LeanSelectable component\u2019s OnSelect and OnDeselect events to call the LeanRevertTransform component\u2019s StopRevert and Revert methods.
This shows you how the Transform3D demo scene can be modified to limit transformation to one gesture at a time. This is done using the LeanGestureToggle component, which can enable/disable the specified twist, pinch, and drag components based on which gesture you perform first.
This shows you how to orbit the camera around a 3D point when you drag across the screen. This is done by making a new GameObject called "Camera Pivot", and adding the LeanMultiSet and LeanPitchYaw components to it. You then connect the LeanMultiSet component's OnDelta event to the LeanPitchYaw.Rotate function. You can then drag and drop your camera to make it a child of this pivot GameObject. The orbit distance can be controlled using the camera's Transform.Position.z setting.
This shows you how the Orbit demo scene can be modified to include camera FOV zooming. This is done by adding the LeanPinchCamera component to your main camera.
This shows you how the Orbit / Zoom demo scene can be modified to allow for mouse wheel adjustment of the zooming. This is done using the LeanMouseWheel component, where its OnDelta event is connected to the LeanPinchCamera component's MultiplyZoom method. The LeanMouseWheel component's Coordinate setting should be set to OneBased, so it sends values suitable for multiplication.
This shows you how the Orbit / Zoom demo scene can be modified to zoom relative to where on the screen you pinch. This is done by enabling the LeanPinchCamera component's Relative setting. The ScreenDepth setting must also be set so the relative calculations are based on the correct depth (not important with an orthographic camera).
This shows you how the Orbit demo scene can be modified to include auto rotation when you stop rotating the orbit for more than 1 second. This is done by adding the LeanPitchYawAutoRotate component alongside the LeanPitchYaw component.
This shows you how the CameraOrbit demo scene can be modified to allow the camera to move
This shows you how the CameraOrbitDolly demo scene can be modified to stop objects blocking
This shows you how the pivot point of an orbiting camera can snap to your object selection.
This shows you how the Orbit demo scene be modified to allow manual movement of the orbit center point. This is done by adding the LeanDragcamera component to your camera pivot GameObject. You can then change the LeanDragCamera.ScreenDepth setting to CameraDistanceAuto, and adjust the Use.RequiredFingerCount settings to prevent your controls from conflicting.
This shows you how the Orbit / Move demo scene can be modified to work in a top down scenario. This is done by adding the LeanDragCamera component to the camera pivot point with a ScreenDepth setting of PlaneIntercept with a LeanPlane that lies flat on the ground plane.
This shows you how to modify the Orbit demo scene to rotate the camera when you swipe the screen. This is done by replacing the LeanMultiDrag component with the LeanFingerSwipe component, and connecting its OnDelta event to the LeanPitchYaw.Rotate method.
This shows you how the LeanPitchYaw component's SetYaw and SetPitch functions can be called from UI buttons to reset the pitch, yaw, or both, to a specific value. This allows you to focus the camera on a specific point of interest.
This shows you how to make a first person camera that can look around when you drag the screen.
This shows you how LeanPitchYaw/Smooth can be split in two, allowing you to translate the camera locally without using the camera pitch like in an FPS game.
This shows you how the FirstPersonLook demo scene can be modified to allow you to tap look as well.
This shows you how to create a free flight camera system, where you have 6 degrees of freedom. You can see the children of the Main Camera GameObject to see how this is set up. One Finger Drag = Pitch/Yaw. Twist = Roll. Two Finger Drag = Left/Right & Down/Up. Pinch = Forward/Back.
This shows you how the FreeflightCamera demo scene can be modified to allow movement of a Rigidbody camera. This is done by replacing the LeanManualTranslate components with the LeanManualTranslate Rigidbody component.
This shows you how to make a GameObject that can be controlled across 6 degrees of freedom.
This shows you how the LeanDragCamera component can be added to your camera to create a 2D sidescrolling camera.
This shows you how the Sidescroll 2D demo scene can be modified to include camera zooming. This is done by adding the LeanPinchCamera component to the camera GameObject.
This shows you how the LeanConstrainToOrthographic component can be used to constrain an orthographic camera to a LeanPlane with a fixed size, even when the camera's orthographic size/zoom changes.
This shows you how the Sidescroll 2D / Zoom demo scene can be modified to include camera rotation. This is done by adding the LeanTwistCamera component to the camera GameObject.
This shows you how the Sidescroll2DZoomRotate demo scene can be modified to work like most 2D map applications. This is done by enabling the LeanPinchCamera.Relative and LeanTwistCamera.Relative settings. The current camera control mode can be toggled between using the LeanGestureToggle component, which will change based on the first gesture you perform.
This shows you how the LeanDragCamera component can be added to your camera to create a 3D sidescrolling camera.
This shows you how the Sidescroll 3D demo scene can be modified to include camera zooming. This is done by adding the LeanPinchCamera component to the camera GameObject.
This shows you how the Sidescroll 3D / Zoom demo scene can be modified to include camera rotation. This is done by adding the LeanTwistCamera component to the camera GameObject.
This shows you how the LeanFingerSwipe and LeanManualTranslate components
This shows you how the LeanFingerSwipe and LeanManualTranslate components
This shows you how the TopDownSwipeMove demo scene can be combined with the ConstrainToCollider demo scene, adding a BoxCollider to the camera movement.
This shows you how to make it so finger drags can both rotate the camera, and move selected objects, without either action conflicting. This is done using the LeanSelectedCount component, which invokes events based on how many objects you have selected. These events can be used to enable/disable the LeanMultiUpdate component, which is used to control the camera orbit.
This shows you how to control camera zoom using a one finger drag up or down gesture. This is done using the LeanPinchCamera for the camera zoom, and setting Use = ManuallyAddedFingers to disable the default pinch gesture to zoom. The LeanMultiDirection component is then used to detect the vertical (up & down) finger movement. Its OnDelta event sends the delta to the LeanPinchCamera.IncrementZoom method. You can control the drag direction using the Angle setting.
This shows you how the LeanFingerDownCanvas component can be added to your UI elements, allowing you to detect when a finger presses down on it. In this scene the LeanFingerDownCanvas.OnWorld event is used to output the world position of the finger to the LeanFormatString component's SetString function.
This shows you how to move an object when you press on a UI element. This is done using the LeanFingerDownCanvas and LeanManualTranslate components. The LeanFingerDownCanvas.OnFingers event calls the LeanManualTranslate.TranslateB function, with different distance values to change direction. The movement axis can be changed from the LeanManualTranslate.DirectionB setting.
This shows you how LeanFingerSwipe.OnSwipeDelta can be linked to LeanManualTranslate.Translate, to translate a GameObject along custom axes.
This shows you how the LeanMultiSetCanvas component can be added to your UI elements, allowing you to detect when fingers are touching it. In this scene the LeanMultiSetCanvas.OnWorldTo event is used to output the world position of the finger to the LeanFormatString component's SetString function.
This shows you how LeanFingerDownCanvas can manually send fingers to LeanMultiSet.
This shows you how LeanCanvasSet can trigger LeanManualRotate/Smooth.RotateA/B,
This shows you how LeanFingerDownCanvas can manually send fingers to LeanMultiSet.
This shows you how to spawn objects when a finger touches down on an UI element, and how to position the object under the finger until it releases. This is done by adding the LeanFingerDownCanvas component to your UI element, and the LeanSpawnWithFinger component. The LeanFingerDownCanvas.OnFinger event is connected to the LeanSpawnWithFinger.Spawn function, which will spawn the object when you touch the UI element. The LeanSpawnWithFinger.DragAfterSpawn setting is then enabled to allow dragging of the spawned object until the spawning fingers stops touching the screen.
This shows you how to modify the Drag To Spawn demo scene to select the spawned object while the spawning finger is still touching the screen. This is done by enabling the LeanSpawnWithFinger component's SelectOnSpawn and DeselectOnUp settings. Keep in mind the spawned prefab must have the LeanSelectable component. In this demo scene the LeanSelectableRendererColor component is also used to show the color of the selected object.
This shows you how the Drag To Spawn / Selectable demo scene can be modified to work with Rigidbody GameObjects. This is done by enabling the prefab's Rigidbody.isKinematic setting, and connecting the prefab's LeanSelectableByFinger.OnDeselected event to the Rigidbody.isKinematic = false function.
This shows you how the Drag To Spawn demo scene can be modified to destroy the spawned prefab if it's dropped on top of a UI element. This is done by enabling the LeanSpawnWithFinger component's DestroyIfBlocked setting.
This shows you how the Drag To Spawn / Destroy If Blocked demo scene can be modified to destroy the spawned prefab if it's not dropped on the correct GameObject. This is done using tags, and setting the LeanSpawnWithFinger component's ScreenQuery.RequiredTag setting.
This shows you how the Drag To Spawn / Selectable / Drop demo scene can be modified to spawn a different prefab based on your swipe direction. This is done using multiple LeanManualFlick components with different angle requirements. The LeanFingerDownCanvas.OnFinger event is instead used to send the finger to each of these components using the LeanManualFlick.AddFinger function. The LeanManualFlick.OnFinger even is then connected to each LeanSpawnWithFinger.Spawn function to perform the spawn based on the direction you swiped in.
This shows you how LeanMultiDrag.OnDragDelta can trigger LeanManualRotate.Rotate, allowing you to rotate a GameObject along custom axes.
This shows you how the position of an object can be constrained to a box shape using the LeanConstrainToBox component.
This shows you how the position of an object can be constrained along a specific axis using the LeanConstrainToAxis component. You can control the axis with the Axis setting, and adjust the Minimum and/or Maximum values.
This shows you how the position of an object can be constrained to be inside a collider using the LeanConstrainToCollider component. If you don't want your boudnary to collide with your other objects then you can enable the isTrigger setting, and/or place the boundary on a layer that doesn't collide.
This shows you how the position of an object can be constrained to be inside multiple colliders using the LeanConstrainToColliders component. If you don't want your boudnary to collide with your other objects then you can enable the isTrigger setting, and/or place the boundary on a layer that doesn't collide.
This shows you how the rotation of a Transform can be constrained to be inside the specified cone. You can select the Red Cube GameObject to see the cone in the Scene tab.
This shows you how your Rigidbody can be constrained within a boundary. This is done by adding colliders to your boundary and object, and using the LeanDragTranslateRigidbody component on your object. Keep in mind this scene enables the Rigidbody.Constraints.FreezePosition.Z setting to maintain the side-scrolling effect.
This shows you how your Rigidbody2D can be constrained within a boundary. This is done by adding colliders to your boundary and object, and using the LeanDragTranslateRigidbody2D component on your object.
This shows you how LeanSelectableDial can be used to turn objects around an axis like a knob or dial.
This shows you how LeanSelectableDial can be used to turn objects around an axis like a knob or dial.
This shows you how LeanSelectableDial can be used to turn objects around an axis like a knob or dial.
This shows you how LeanSelectableDial can be used to turn objects around an axis like a knob or dial.
This shows you how LeanSelectableDial can be used to turn objects around an axis like a knob or dial.
This shows you how LeanSelectableDial can be used to turn objects around an axis like a knob or dial.
This shows you how LeanSelectableDial can be used
This shows you how LeanSelectableDial can be used to turn objects around an axis like a knob or dial.
This shows you how LeanSelectableDial can be used to turn objects around an axis like a knob or dial.
This shows you how to modify DragTurn2D to be 1D by setting LeanManualRotate2D/Smooth.Axis B to 0,0,0.
This shows you how LeanMultiDrag.OnDragDelta can trigger LeanManualRotate.Rotate, allowing you to rotate a GameObject along custom axes.
This shows you how LeanMultiDrag.OnDragDelta can trigger LeanManualRotate.Rotate, allowing you to rotate a GameObject along custom axes.
This shows you how to modify DragTurn2D to be 1D by setting LeanManualRotate2D/Smooth.Axis B to 0,0,0.
This shows you how the DragTurn2D demo scene can be modified to have stepped rotation instead of continuous rotation. This is done using the LeanThresholdDelta component. By changing the LeanMultiSet.OnDelta to LeanThresholdDelta.AddXY, the LeanThresholdDelta.Current value is smoothly incremented. Once this reaches the Threshold with Step enabled, it will invoke the OnDeltaXY event, which sends the stepped values to LeanManualRotate.RotateAB.
This shows you how the Press3D and DragTurn1D demo scene can be combined to make doors that you can open and close by dragging across them. The LeanPitchYaw component\u2019s YawClamp setting to set rotation limits.
This shows you how the DragMove2D demo scene can be modified to limit translation to 1 axis. This is done by setting the LeanManualTranslate component\u2019s DirectionB setting to 0,0,0.
This shows you how dragging fingers across the screen can move an object along custom axes. This is done using the LeanMultiDrag component, and having its OnDelta event call the LeanManualTranslate component\u2019s TranslateAB method.
This shows you how the LeanThresholdDelta component can be used between the LeanMultiSet and LeanManualTranslate components using events to only move the object when your finger/mouse moves more than 1 unit.
This shows you how to drag objects along a LeanPath using the LeanDragTranslateAlong component.
This shows you how to drag objects along a LeanPath using the LeanDragTranslateAlong component.
This shows you how to drag objects along a LeanPath using the LeanDragTranslateAlong component.
This shows you how LeanDragTranslateAlong can be used to move objects along a LeanPlane.
This shows you how the DragAlongPlane demo scene can be modified to allow snapping to a grid.
This shows you how LeanMultiDrag.OnDragDelta can trigger LeanManualRotate.Rotate, allowing you to rotate a GameObject along custom axes.
This shows you how LeanMultiDrag.OnDragDelta can trigger LeanManualRotate.Rotate, allowing you to rotate a GameObject along custom axes.
This shows you how LeanMultiDrag.OnDragDelta can trigger LeanManualRotate.Rotate, allowing you to rotate a GameObject along custom axes.
This shows you how to modify DragTurn2D to be 1D by setting LeanManualRotate2D/Smooth.Axis B to 0,0,0.
This shows you how to modify DragTurn2D to be 1D by setting LeanManualRotate2D/Smooth.Axis B to 0,0,0.
This shows you how the Select3D demo scene can be modified to allow vertex color painting. This is done by adding the LeanDragColorMesh component to your selectable objects alongside a MeshFilter.
This shows you how the Select3D demo scene can be modified to allow vertex position shifting. This is done by adding the LeanDragDeformMesh component to your selectable objects alongside a MeshFilter.
This shows you how Press2DTranslate can be modified so any with LeanSelectableDrop GameObjects get destroyed by LeanDropDestroy when dropped on top.
This shows you how Press2DTranslate can be modified so any with LeanSelectableDrop GameObjects get destroyed by LeanDropDestroy when dropped on top.
This shows you how the LeanChase component can be used to make the red cube follow fingers around the screen. This is done using the LeanMultiSet component, where the OnPosition event can send a position to the LeanChase.SetPosition method.
This shows you how the Chase 3D and Press3D demo scenes can be combined.
This shows you how to make an object follow different waypoints when you press a button. This is done by placing a Transform in the scene, and having the button's event set the LeanChase.Destination value to the specified waypoint. The GameObject with the LeanChase component will then move toward that point.
This shows you how to make a Rigidbody chase the fingers touching the screen. This is done using the LeanChase Rigidbody component, where the chase position is driven using the LeanMultiPosition and LeanConvertPosition components. The LeanMultiPosition.OnPosition event is connected to the LeanConvertPosition.Convert method. The LeanConvertPosition.OnPosition event is connected to the LeanChaseRigidbody.SetPosition method.
This shows you how the Chase Rigidbody demo scene can be modified to allow for dragging along a custom plane, rather than maintaining a constant camera distance. This is done by changing the LeanMultiSet.ScreenDepth setting to PlaneIntercept, and specifying our custom LeanPlane that aligns to the grid.
This shows you how to make a Rigidbody2D chase the fingers touching the screen. This is done using the LeanChaseRigidbody2D component, where the chase position is driven using the LeanMultiPosition and LeanConvertPosition components. The LeanMultiPosition.OnPosition event is connected to the LeanConvertPosition.Convert method. The LeanConvertPosition.OnPosition event is connected to the LeanChaseRigidbody2D.SetPosition method.
This shows you how LeanSelectable.OnSelect can call LeanFollowFinger.BeginFollowing.
This shows you how the FollowFinger demo scene can be modified to only allow movement when the selecting finger stops touching the screen. This is done by disabling the LeanFollow component, and enabling it from the LeanSelectable.OnDeselect event. Upon completion, the LeanFollow component disables itself from the OnReachedDestination event.
This shows you how the FollowFinger demo scene can be modified so the following objects rotate to the direction of the path. This is done by adding the LeanRotateToPosition component to your selectable object. The LeanRotateToPosition .RotateTo setting can be adjusted based on your scene setup, which in this case is a sidescrolling scenario, so the Side2D setting works well.
This shows you how the Line demo scene can be combined with the FollowFinger demo scene, causing an object to spawn and follow the path of a line you draw on the screen. This makes heavy use on the LeanDragLine component's OnReleasedFrom and OnReleasedTo events. These set up the prefab settings before spawning, then spawn when released.
This shows you how the LeanDragLine component can be used to draw a straight line under each finger touching the screen. The line style can be customized using the Prefab setting, which has a LineRenderer.
This shows you how the LeanDragLine can be used to draw a line under each finger.
This shows you how the length of the line can be clamped using the LeanDragLine component's LengthMin and LengthMax settings.
This shows you how to spawn and throw a Rigidbody when your finger stops touching the screen. This is done using the LeanSpawnBetween component, whose Spawn function can be triggered from the LeanDragLine component's OnReleasedFromTo event.
This shows you how to spawn and throw a Rigidbody2D when your finger stops touching the screen. This is done using the LeanSpawnBetween component, whose Spawn function can be triggered from the LeanDragLine component's OnReleasedFromTo event.
This shows you how the Line / Clamp demo scene can be modified so the line always begins at the object center. This is done by enabling the LeanDragLine component's StartAtOrigin setting.
This shows you how the Target 3D demo scene can be modified to throw a Rigidbody around the screen with a power indicator following each finger. This is done by adding the LeanManualTranslateRigidbody component, and linking the LeanDragLine component's OnReleaseDelta event to the LeanManualTranslateRigidbody.TranslateWorld method.
This shows you how the Select 3D and Target 3D / Throw demo scenes can be combined, allowing you to throw objects under the finger with a strength indicator.
This shows you how the Line / Clamp demo scene can be modified so the line always begins at the object center. This is done by enabling the LeanDragLine component's StartAtOrigin setting.
This shows you how the Target 3D demo scene can be modified to throw a Rigidbody2D around the screen with a power indicator following each finger. This is done by adding the LeanManualTranslateRigidbody component, and linking the LeanDragLine component's OnReleaseDelta event to the LeanManualTranslateRigidbody.TranslateWorld method.
This shows you how the Target 2D / Throw demo scene can be modified to rotate the Rigidbody2D to match the throw indicator. This is done using the LeanRotateToPosition component with a Position setting of ManuallySetPosition, and a RotateTo setting of Side 2D. The rotate to position is manually set using the LeanMultiPull component's OnWorldTo event.
This shows you how the Select 2D and Target 2D / Throw demo scenes can be combined, allowing you to throw objects under the finger with a strength indicator.
This shows you how the LeanDragLine component's ScreenDepth setting can be set to PathClosest, allowing you to limit the launch angle to the specified path.
This shows you how LeanSelect.Reselect can be set to Select Again, and how you can use LeanSelect.OnSelect to count how many times it's selected again.
This shows you how the Press To Select demo scene can be modified to show you how long you\u2019ve selected an object for. This is done by adding the LeanSelectableTime component whose OnSeconds event can be used to perform some action. In this scene the LeanFormatString component is used to display the time using UI text.
This shows you how Select2D can be combined with LeanSelectableSelected/Time to trigger LeanSelectable.Deselect after 1 second.
This shows you how LeanDragSelect can select multiple objects using a drag gesture.
This shows you how the DragSelect and TranslateRelative demo scenes can be combined, allowing screen drags to both allow selection of objects, as well as translation of objects.
This shows you how the LeanDragSelect.MaximumSeparation can be used to only allow you to select objects within range of the previously selected object.
This shows you how to select objects in the style of strategy games by dragging a selection box across the screen. This is done using the LeanSelectionBox component, where its Root setting is set to your canvas root, and the Prefab setting is set to a selection box prefab that will be spawned when you drag across the screen.
This shows you how to select objects in the style of strategy games by dragging a selection box across the screen. This is done using the LeanSelectionBox component, where its Root setting is set to your canvas root, and the Prefab setting is set to a selection box prefab that will be spawned when you drag across the screen.
This shows you how the LeanPickable component can be used to detect when you touch a GameObject without using the selection system. This object can then be picked by making a new GameObject with the LeanPick component, whose SelectScreenPosition function can be called from a component that gives you a finger, like the LeanFingerTap component's OnFinger event used in this scene. This pick system doesn't require the LeanSelect/ByFinger or LeanSelectable/ByFinger components to work, so it can be used for more complex scenarios where normal selection alone isn't enough.
This shows you how the Pickable demo scene can be modified to work using the LeanFingerDown component, giving you instant picking that feels more responsive.
This shows you how the Pickable / Down demo scene can be modified to work like press selection. This is done using the LeanMultiUp component with its Use setting set to ManuallyAddedFingers. The LeanPickable.OnFinger event is used to change the object material to indicate selection, and also add the finger via the LeanMultiUp.AddFinger function. The LeanMultiUp.OnFinger event is then used to detect when all fingers go up, and revert the material to its original state.
This shows you how the Pickable / Down demo scene can be modified to work like press selection. This is done using the LeanMultiUp component with its Use setting set to ManuallyAddedFingers. The LeanPickable.OnFinger event is used to change the object material to indicate selection, and also add the finger via the LeanMultiUp.AddFinger function. The LeanMultiUp.OnFinger event is then used to detect when all fingers go up, and revert the material to its original state.
This shows you how to detect drawing of basic letter shapes. This is done using the LeanShapeDetector component, which detects the specified LeanShape component. You can select a shape and click the Draw button to modify it. You can modify the LeanShapeDetector's DistanceThreshold and ErrorThreshold settings to make the shape easier or more difficult to draw.
This shows you how LeanShape.ConnectEnds can be enabled. This allows you to make a looped shape.
This shows you how the ShapeDetector / Loop demo scene can be modified to allow for detection of the drawing direction. This is done using two LeanShapeDetector components, where you change the Direction setting to Forward or Backward. You can then link the OnDetected events to perform custom actions in either scenario.
This shows you how the LeanShapeDetector.MinimumPoints setting allows you to detect partial shape matches.
This shows you how LeanFingerSwipe can trigger LeanSwap to swap between a selection of prefabs.
This shows you how LeanFingerSwipe can trigger LeanSwap to swap between a selection of prefabs.
This shows you how LeanFingerSwipe.OnSwipeDelta can be linked to LeanManualTranslate.Translate, to translate a GameObject along custom axes.
This shows you how LeanFingerSwipe.OnSwipeDelta can be linked to LeanManualRotate.Rotate, to rotate a GameObject along custom axes.
This shows you how to combine Select3D and DragToThrowTarget, allowing you to throw objects around the screen with force indicators.
This shows you how to combine Select3D and DragToThrowTarget, allowing you to throw objects around the screen with force indicators.
This shows you how to combine Select3D and DragToThrowTarget, allowing you to throw objects around the screen with force indicators.
This shows you how to combine Select3D and DragToThrowTarget, allowing you to throw objects around the screen with force indicators.
This shows you how to combine Select3D and DragToThrowTarget, allowing you to throw objects around the screen with force indicators.
This shows you how to combine Select3D and DragToThrowTarget, allowing you to throw objects around the screen with force indicators.
This shows you how to instantly detect swipes, even while your finger is still moving across the screen. This is done using the LeanFingerFlick component. You can control the maximum flick duration and minimum flick distance from the LeanTouch component's TapThreshold and SwipeThreshold settings respectively.
This shows you how to rotate a UI element based on a screen flick gesture. This is done using the LeanFingerFlick and LeanRoll components, and connecting the LeanFingerFlick.OnDelta event to the LeanRoll.RotateToDelta function.
This shows you how the LeanFingerFlick component's Check setting can be set to Multiple. This allows you to detect multiple flicks from the same finger, as long as the finger movement pauses between each flick. The time and movement required between each flick can be controlled using the LeanTouch component's TapThreshold and SwipeThreshold settings.
This shows you how to detect multi finger swipe gestures using the LeanMultiSwipe component. This can detect when multiple fingers swipe in parallel, when multiple fingers swipe inward, and when multiple fingers swipe outward.
Here's a list of all my other assets, please check them out!
You can also view this list on my Asset Store page.
Rapidly develop your game with consistent input across desktop & mobile using Lean Touch. This lightweight asset comes with many modular components, allowing you to customize them to your exact project needs!
Lean Touch+ is an extension to the popular Lean Touch asset, adding many more example scenes.
Lean Localization is a localization library that's designed to be as simple to use as possible for both designers, and programmers.
Quickly optimize the performance of your games using Lean Pool. Within minutes you can use this lightweight asset to preload, recycle, and limit the spawning of your prefabs.
Quickly polish your games using Lean Transition. This asset allows you to easily tween or animate almost anything in your game, making it transition smoothly.
Lean GUI is a colllection of components that extend Unity's GUI system, allowing you to rapidly enhance the user experience (UX) of your game's UI.
Lean GUI Shapes allows you to quickly add lines, rounded boxes, polygons, and much more to your GUI!
Lean Texture allows you quickly modify textures in your project with a range of filters, pack them together into channels, and much more!
Lean Texture+ is an extension to Lean Texture, adding many new types of texture modification tools!
Unlock a universe of visual possibilities with Modular Backgrounds. Simply drag and drop these graphics into the background of your scenes.
Paint all your objects using Paint in 3D - both in game, and in editor. All features are optimized with GPU accelerated texture painting, so you can enjoy consistent performance, even if you paint your objects one million times!
Paint all your sprites with Paint in 2D. With incredible performance on mobile, WebGL, and much more!
Paint in Editor unlocks the ability to paint objects in your scene - great for making small tweaks, or even creating entirely new texture sets!
FLOW allows you to add large scale interactive fluids to your scene - all highly optimized using GPU acceleration.
Unlock the full potential of your 2D games using Destructible 2D, this asset allows you to quickly convert all your boring solid sprites into fully destructible ones!
Quickly make the space scene of your dreams using Space Graphics Toolkit. This huge collection of space effects can be customized and combined in any way you like, allowing you to quickly make realistic or fantasy worlds. Each feature has been heavily optimized to run on almost any device and platform.
Enhance your space scenes using this large pack of high detail volumetric planets. These planets are finished using the powerful planet features from Space Graphics Toolkit (not required).
Unity sounds only emanate from a single point source. This is great for explosions and footsteps, but quite often you need something more advanced. Volumetric Audio is an easy to use package that allows you to define boxes, spheres, capsules, paths, or meshes that sounds can emanate from.
Moved main build to Unity 2020.3.0f1.
All canvas components now have IgnoreStartedOverGui disabled by default.
Removed LeanDragTranslateAlong.TrackScreenPosition setting (it's now always on).
Added LeanDragTranslateAlongRigidbody component.
Added LeanMultiUpdate.Constrain setting.
Added LeanMultiUpdateCanvas.Constrain setting.
Changed folder structure to be inside Plugins/CW/LeanTouch+.
Updated inspector code to support third party assets that implement nested inspectors.
Fixed LeanConstrainLocalPosition using world space.
Added LeanManualRotate.RotateAxesToCamera setting.
Added LeanManualTranslate.RotateDirectionsToCamera setting.
Added LeanManualTranslateRigidbody.RotateDirectionsToCamera setting.
Added LeanManualTranslateRigidbody2D.RotateDirectionsToCamera setting.
Added LeanManualVelocity.RotateDirectionsToCamera setting.
Added LeanManualVelocity2D.RotateDirectionsToCamera setting.
Fixed Drag To Spawn / Destroy If Blocked / Required Tag demo scene.
Fixed transform gizmos not appearing in Unity 2021.2.
Renamed LeanSpawnWithFinger.ScreenQuery setting to BlockedScreenQuery.
Added LeanSpawnWithFinger.DestroyIfMissing setting.
Added LeanSpawnWithFinger.MissingScreenQuery setting.
Added LeanSelectionBox.RequiredLayers setting.
Added LeanSelectionBox.RequiredTags setting.
Added LeanSpawnWithFinger.DestroyIfBlocked / ScreenQuery setting.
Added LeanSelectableDrop.Ignore setting for easier use.
Rewrote LeanSelectableDrop to use new ScreenQuery system.
Fixed LeanSelectableByFinger.OnSelectedFingerUp event not showing in inspector.
Added LeanSpawnWithFinger.DestroyIfBlocked setting.
Added LeanSpawnWithFinger.DeselectOnUp setting.
Added Canvas / Drag To Spawn / Destroy if Blocked demo scene.
Moved main build to Unity 2019.4.12f1.
Fixed LeanDragTranslateAlong positional drift.
Fixed LeanFingerTapQuick adding RectTransform.
Added Selection / Select Self / Down demo scene.
Improved LeanMultiUp component implementation.
Improved LeanDropCount component implementation.
Renamed LeanSelectSelf to LeanPickable.
Fixed LeanPinchCamera inspector error.
Added LeanManualTorque component.
Added Drag/DragTorque demo scene.
Added LeanManualRescale component.
Added Drag/DragRescale demo scene.
Added LeanDelayedValue component.
Added LeanMultiDown component.
Added LeanMultiUp component.
Replaced LeanPitchYaw.RotateToFinger with RotateToScreenPosition.
Added LeanFirstDown.OnScreen event.
Added Camera/Conflicting Controls demo scene.
Replaced LeanAnySelected component with LeanSelectedCount.
Added LeanSelected component.
Added LeanDeselected component.
Fixed LeanChaseRigidbody component.
Added LeanMultiHeld component.
Added Multi Held demo scene.
Added LeanSelectableDial.IncrementAngle method.
Added LeanPinchCamera.IncrementZoom method.
Added Camera / One Finger Zoom demo scene.
Fixed LeanConstrainToDirection component.
Fixed LeanSelectSelf with Search = GetComponentInParent.
Fixed ScreenDepth = PlaneIntercept when using an offset.
Fixed LeanMultiDirection.Angle setting.
Fixed LeanSelectableDial.Tilt implementation.
Added LeanChaseRigidbody2D.Axis setting.
Added LeanFirstDownCanvas component.
Added LeanLastUpCanvas component.
Added LeanMultiDirection component.
Added Drag/Direction demo scene.
Added LeanSelectableDial.OnAngleChanged event.
Fixed LeanPinchCamera inspector.
Added multi finger support to LeanDragSelect component.
Added LeanManualTranslate.DefaultPosition value.
Added LeanManualTranslate.ResetPosition method.
Added LeanManualTranslate.SnapToTarget method.
Added LeanManualRotate.SnapToTarget method.
Added Linear setting to LeanChase components.
Added Canvas / Swipe Direction Spawn demo scene.
Added LeanPitchYaw.RotateToPosition method.
Added LeanPitchYaw.RotateToDirection method.
Added LeanSelectSelf.Root setting.
Added LeanManualFlick component.
Separated LeanConstrainToBox from BoxColliders.
Added LeanConstrainToAxis component.
Added Constrain / Constrain To Box demo scene.
Added Constrain / Constrain To Axis demo scene.
Rewrote LeanShapeDetector to use a different implementation.
Implemented LeanShapeDetector.Use setting.
Added Line / Target 2D / Throw / Rotate demo scene.
Added Swipe / Finger Flick / Multiple demo scene.
Added LeanRotateToPosition.Target setting.
Added LeanRotateToPosition.Invert setting.
Added LeanFingerFlick.Check setting.
Added thresholds to LeanConstrainTo__ components for better performance.
Updated LeanTouch.
Renamed LeanFingerHeld.OnFingerSet to .OnFingerUpdate.
Renamed LeanFingerHeld.OnWorldSet to .OnWorldUpdate.
Renamed LeanSelectableSelected.OnSelectableSet to .OnSelectableUpdate.
Moved main build to Unity 2018.4.13f1.
Added Constrain / Constrain Rigidbody demo scene.
Added Constrain / Constrain Rigidbody2D demo scene.
Added LeanFirstDown component.
Added LeanLastUp component.
Added First Down & Last Up demo scene.
Fixed LeanDragTranslateRigidbody2D with perspective cameras.
Renamed LeanMultiSet to LeanMultiUpdate.
Renamed LeanMultiSetCanvas to LeanMultiSetUpdate.
Renamed LeanSelectable.OnSelectSet to OnSelectUpdate.
Restructured all demo scenes to be easier to use.
Added LeanThresholdPosition component.
Added LeanThresholdDelta component.
Added DragMove2DThreshold demo scene.
Added LeanDragTranslateAlong.Target setting.
Added Line / SpawnThrow Rigidbody2D demo scene.
Added LeanSpawn.DefaultPosition setting.
Added LeanSpawn.DefaultRotation setting.
Added LeanMultiSetCanvas.OnWorld event.
Fixed LeanFingerHeld.OnPositionUp not being called.
Renamed LeanFingerHeld.OnPositionDown to OnWorldDown.
Renamed LeanFingerHeld.OnPositionSet to OnWorldSet.
Renamed LeanFingerHeld.OnPositionUp to OnWorldUp.
Moved main build to Unity 2018.4.0f1.
Updated documentation.
Added asmdef.
Added LeanMultiPinch.Coordinate = ZeroBasedRatio setting.
Added LeanMultiPinch.Coordinate = ZeroBasedDistance setting.
Added LeanRotateToPosition.Threshold setting.
Added DialUI demo scene.
Renamed LeanRotateToTransform to LeanRotateToPosition.
Fixed ScreenDepth = HeightIntercept axis label.
Added LeanRotateToPosition.Position setting.
Added LookAt demo scene.
Added LookAtSelectable demo scene.
Added ConstrainScale demo scene.
Added FollowFingerReleased demo scene.
Added DragAlongPathSmooth demo scene.
Fixed inspector expand buttons in UI Elements.
Fixed LeanDragTranslate being slow in some scenarios.
Fixed LeanTwistRotate being slow in some scenarios.
Fixed LeanPinchScale being slow in some scenarios.
Updated common library code.
Added FollowFingerReleased demo scene.
Added DragAlongPathSmooth demo scene.
Fixed inspector expand buttons in UI Elements.
Fixed LeanDragTranslate being slow in some scenarios.
Fixed LeanTwistRotate being slow in some scenarios.
Fixed LeanPinchScale being slow in some scenarios.
Added MultiTwist demo scene.
Added MultiTwistOneFinger demo scene.
Added MultiTwist.OneFinger setting.
Fixed MultiSwipe demo scene.
Fixed MultiTap demo scene.
Added CanvasSwipeMove demo scene.
Fixed LeanSelectable.IsolateSelectingFingers when using RequiredFingerCount.
Fixed Added LeanSelectableBehaviour error when missing LeanSelectable.
Added LeanSelectable.Register for manual registration.
Added LeanSelectable.Unregister for manual unregistration.
Added LeanTouch.OnFingerInactive event.
Added SelectionBoxDotted demo scene.
Added PullTurn2D demo scene.
Added LeanMultiPull component.
Improved Dial demo scene.
Improved DialTrigger demo scene.
Improved SelectionBox demo scene.
Redesigned all demo scenes.
Added smoothing/dampening to all base components.
Removed all ___Smooth versions of components.
Renamed IDroppable to IDropHandler.
Renamed LeanCameraDolly to LeanMaintainDistance.
Removed LeanConstrainToBox (use LeanConstrainToCollider instead).
Renamed LeanFollowSmooth to LeanFollow.
Renamed LeanCanvasFingers to LeanFingerDownCanvas.
Renamed LeanTranslateRigidbody to LeanDragTranslateRigidbody.
Renamed LeanTranslateRigidbody2D to LeanDragTranslateRigidbody2D.
Removed LeanPitchYawSwipe component.
Removed LeanMultiSetCanvas (use LeanFingerDownCanvas + LeanMultiSet instead).
Merged LeanCanvasArrowSmooth into LeanRoll.
Merged LeanTranslateSmooth into LeanDragTranslate.
Merged LeanCameraZoomSmooth into LeanPinchZoom.
Merged LeanCameraMoveSmooth into LeanDragMove.
Merged LeanFingerLineFade into LeanFingerLine.
Merged LeanFingerTrailFade into LeanFingerTrail.
Any component implementing this interface will make it compatible with LeanSelectableDrop, allowing you to perform a specific action when the current object is dropped on something.
This script allows you to paint the vertices of the current MeshFilter's mesh.
The method used to find fingers to use with this component. See LeanFingerFilter documentation for more information.
The color you want to paint the hit triangles.
The camera this component will calculate using.
None/null = MainCamera.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually add a finger.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually remove a finger.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually remove all fingers.
This script allows you to drag mesh vertices using finger drags.
The method used to find fingers to use with this component. See LeanFingerFilter documentation for more information.
Radius around the finger the vertices will be moved in scaled screen space.
Should mesh deformation be applied to an attached MeshCollider?
The camera this component will calculate using.
None/null = MainCamera.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually add a finger.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually remove a finger.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually remove all fingers.
This component modifies LeanDragTrail to draw straight lines.
The StartWidth and EndWidth values will be increased by this value multiplied by the line length.
0 = No change.
The minimum length of the straight line in world space.
-1 = Unrestricted.
The maximum length of the straight line in world space.
-1 = Unrestricted.
Enable this if the line should begin from this Transform's position.
Drag the line backwards?
This event gets called when a trail drawing finger goes up.
Vector3 = Start world point.
This event gets called when a trail drawing finger goes up. The parameter contains the end point in world space.
Vector3 = End world point.
This event gets called when a trail drawing finger goes up. The parameter contains the end point in world space.
Vector3 = Vector between start and end world points.
This event gets called when a trail drawing finger goes up.
Vector3 = Start point in world space.
Vector3 = End point in world space.
This component allows you to select multiple objects by dragging across the screen through them.
The select component that will be used.
If you begin dragging while objects are already selected, skip?
If you begin dragging on a point that isn't above a selectable object, skip?
Automatically deselect all objects when the drag starts?
Must the next selected object be within a specified world space distance?\n\n0 = Any distance.
This component allows you to translate the current GameObject along the specified surface.
If you want this component to work on a different Transform, then specify it here. This can be used to improve organization if your GameObject already has many components.
None/null = Current Transform.
The method used to find fingers to use with this component. See LeanFingerFilter documentation for more information.
The method used to find world coordinates from a finger. See LeanScreenDepth documentation for more information.
If you want this component to change smoothly over time, then this allows you to control how quick the changes reach their target value.
-1 = Instantly change.
1 = Slowly change.
10 = Quickly change.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually add a finger.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually remove a finger.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually remove all fingers.
This component works like LeanDragTranslateAlong, but is specifically designed to work with a Rigidbody.
This component allows you to drag this rigidbody.
The method used to find fingers to use with this component. See LeanFingerFilter documentation for more information.
The camera this component will calculate using.
None/null = MainCamera.
If you want this component to change smoothly over time, then this allows you to control how quick the changes reach their target value.
-1 = Instantly change.
1 = Slowly change.
10 = Quickly change.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually add a finger.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually remove a finger.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually remove all fingers.
This component allows you to translate the current Rigidbody2D GameObject.
The method used to find fingers to use with this component. See LeanFingerFilter documentation for more information.
The camera this component will calculate using.
None/null = MainCamera.
If you want this component to change smoothly over time, then this allows you to control how quick the changes reach their target value.
-1 = Instantly change.
1 = Slowly change.
10 = Quickly change.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually add a finger.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually remove a finger.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually remove all fingers.
This component implements the 'IDroppable' interface, and will fire events when you drop something on it.
Called on the first frame the conditions are met.
GameObject = The GameObject instance this was dropped.
LeanFinger = The LeanFinger instance this was used to drop the specified GameObject.
This component implements the 'IDroppable' interface, and will count the amount of times you drop a GameObject with the LeanSelectableDrop component on it.
The amount of times you've dropped an object on this.
When the amount of selected objects changes, this event is invoked with the current count.
The minimum amount of objects that must be selected for a match.
-1 = Max.
The maximum amount of objects that can be selected for a match.
-1 = Max.
When the amount of selected objects matches the RequiredCount, this event will be invoked.
When the amount of selected objects no longer matches the RequiredCount, this event will be invoked.
This component works like LeanFingerDown, but only for the UI element this component is attached to.
This component detects swipes while the finger is touching the screen.
Ignore fingers with StartedOverGui?
Ignore fingers with OverGui?
If the specified object is set and isn't selected, then this component will do nothing.
This allows you to choose how the flick will be detected.
Default = Detects one flick within the current TapThreshold time.
IgnoreAge = You can hold the finger for any duration before flicking.
Multiple = You can stop moving the finger for TapThreshold seconds and perform additional flicks.
This component fires events if a finger has been held for a certain amount of time without moving.
Ignore fingers with StartedOverGui?
Ignore fingers with OverGui?
If the specified object is set and isn't selected, then this component will do nothing.
The finger must be held for this many seconds.
The finger cannot move more than this many pixels relative to the reference DPI.
Called on the first frame the conditions are met.
Called on every frame the conditions are met.
Called on the last frame the conditions are met.
The method used to find world coordinates from a finger. See LeanScreenDepth documentation for more information.
Called on the first frame the conditions are met.
Vector3 = Start point based on the ScreenDepth settings.
Called on the first frame the conditions are met.
Vector3 = Current point based on the ScreenDepth settings.
Called on the first frame the conditions are met.
Vector3 = End point based on the ScreenDepth settings.
This component works like LeanFingerHeld, but only for the UI element this component is attached to.
This component works like OnFingerTap, but it will only call events when a finger you've tapped has 'expired'. This allows you to discern between single/double/etc taps.
This component allows you to detect when a finger begins touching the screen after it's done a specific amount of taps. This creates the effect of instantly detecting this tap.
For example, if you want to detect single and double taps, then this component can only be used to detect double taps.
If you want to detect prior taps, then you must use the LeanFingerTapExpired component.
The reason for this is because this component instantly triggers when you begin touching the screen, so it cannot know how many times you will tap after.
Ignore fingers with StartedOverGui?
If the specified object is set and isn't selected, then this component will do nothing.
How many taps must the finger have already performed?
1 = One previous tap, making this component detect the second quick tap.
Called on the first frame the conditions are met.
The method used to find world coordinates from a finger. See LeanScreenDepth documentation for more information.
Called on the first frame the conditions are met.
Vector3 = Start point based on the ScreenDepth settings.
Called on the first frame the conditions are met.
Vector2 = Screen position.
This component allows you to detect when the first finger begins touching the screen.
Ignore fingers with StartedOverGui?
If the specified object is set and isn't selected, then this component will do nothing.
This event will be called if the above conditions are met when you first touch the screen.
The method used to find world coordinates from a finger. See LeanScreenDepth documentation for more information.
This event will be called if the above conditions are met when you first touch the screen.
Vector3 = Finger position in world space.
This event will be called if the above conditions are met when you first touch the screen.
Vector2 = Finger position in screen space.
This component allows you to detect when the first finger begins touching the current UI element.
This component will enable/disable the target pinch and twist components based on total pinch and twist gestures, like mobile map applications.
The method used to find fingers to use with this component. See LeanFingerFilter documentation for more information.
If one specific gesture hasn't been isolated yet, keep them all enabled?
The component that will be enabled/disabled when dragging.
The amount of drag required to enable dragging mode.
The component that will be enabled/disabled when pinching.
The amount of pinch required to enable twisting in scale (e.g. 0.1 = 0.9 to 1.1).
The component that will be enabled/disabled when twisting.
The amount of twist required to enable twisting in degrees.
Enable twist component when pinch component is activated?
If you've set Use to ManuallyAddedFingers, then you can call this method to manually add a finger.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually remove a finger.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually remove all fingers.
This component allows you to detect when the last finger stops touching the screen.
Ignore fingers with StartedOverGui?
If the specified object is set and isn't selected, then this component will do nothing.
This event will be called if the above conditions are met when you finish touching the screen.
The method used to find world coordinates from a finger. See LeanScreenDepth documentation for more information.
This event will be called if the above conditions are met when you finish touching the screen.
Vector2 = Finger position in world space.
This event will be called if the above conditions are met when you finish touching the screen.
Vector2 = Finger position in screen space.
This component allows you to detect when the last finger stops touching the current UI element.
This component works like LeanFingerSwipe, but you must manually add fingers from components like LeanFingerDown, LeanFingerDownCanvas, etc.
Ignore fingers with OverGui?
If the specified object is set and isn't selected, then this component will do nothing.
This allows you to choose how the flick will be detected.
Default = Detects one flick within the current TapThreshold time.
IgnoreAge = You can hold the finger for any duration before flicking.
Multiple = You can stop moving the finger for TapThreshold seconds and perform additional flicks.
This method allows you to manually add a finger.
This method allows you to manually remove a finger.
This component works like LeanFingerSwipe, but you must manually add fingers from components like LeanFingerDown, LeanFingerDownCanvas, etc.
Ignore fingers with OverGui?
If the specified object is set and isn't selected, then this component will do nothing.
This method allows you to manually add a finger.
This method allows you to manually remove a finger.
This component allows you to add mouse wheel control to other components.
Do nothing if this LeanSelectable isn't selected?
When using simulated fingers, should they be created from a specific mouse button?
-1 = Ignore.
0 = Left Mouse.
1 = Right Mouse.
2 = Middle Mouse.
Should the scroll delta be modified before use?
Sign = The swipe delta will either be 1 or -1.
This final delta value will be multiplied by this.
The coordinate space of the output delta values.
ZeroBased = Scrolling where 0 means no scroll.
OneBased = ZeroBased + 1. Scrolling where 1 means no scroll. This is suitable for use with components where you multiply a value.
Called when the mouse scrolls.
Float = Scroll delta.
This component allows you to detect how far one or many fingers move in a specific direction across screen.
The method used to find fingers to use with this component. See LeanFingerFilter documentation for more information.
If there is no movement, ignore it?
The angle we want to detect movement along.
0 = Up.
90 = Right.
180 = Down.
270 = Left.
Set delta to 0 if it goes negative?
The coordinate space of the OnDelta values.
The swipe delta will be multiplied by this value.
This event is invoked when the requirements are met.
Float = Position Delta based on your Coordinate setting.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually add a finger.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually remove a finger.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually remove all fingers.
This component allows you to detect when a specific amount of fingers begin touching the screen.
Ignore fingers with StartedOverGui?
If the specified object is set and isn't selected, then this component will do nothing.
The amount of fingers we are interested in.
This event will be called if the above conditions are met when you first touch the screen.
The method used to find world coordinates from a finger. See LeanScreenDepth documentation for more information.
This event will be called if the above conditions are met when you first touch the screen.
Vector3 = Finger position in world space.
This event will be called if the above conditions are met when you first touch the screen.
Vector2 = Finger position in screen space.
This component allows you to detect when a specific amount of fingers begin touching the screen.
Ignore fingers with StartedOverGui?
Ignore fingers with OverGui?
If the specified object is set and isn't selected, then this component will do nothing.
The amount of fingers we are interested in.
The finger must be held for this many seconds.
The finger cannot move more than this many pixels relative to the reference DPI.
This event will be called if the above conditions are met when you begin holding fingers down.
This event will be called if the above conditions are met when you begin holding fingers down.
This event will be called if the above conditions are no longer met.
The method used to find world coordinates from a finger. See LeanScreenDepth documentation for more information.
This event will be called if the above conditions are met when you first touch the screen.
Vector3 = Finger position in world space.
This event will be called if the above conditions are met when you first touch the screen.
Vector3 = Finger position in world space.
This event will be called if the above conditions are met when you first touch the screen.
Vector3 = Finger position in world space.
This event will be called if the above conditions are met when you first touch the screen.
Vector2 = Finger position in screen space.
This event will be called if the above conditions are met when you first touch the screen.
Vector2 = Finger position in screen space.
This event will be called if the above conditions are met when you first touch the screen.
Vector2 = Finger position in screen space.
This component allows you to get the pinch of all fingers.
The method used to find fingers to use with this component. See LeanFingerFilter documentation for more information.
If there is no pinching, ignore it?
OneBasedScale = Scale (1 = no change, 2 = double size, 0.5 = half size).
OneBasedReciprocal = 1 / Scale (1 = no change, 2 = half size, 0.5 = double size).
ZeroBasedScale = Scale - 1 (0 = no change, 1 = double size, -0.5 = half size).
ZeroBasedRatio = 1 / Scale - 1 (0 = no change, 1 = half size, -0.5 = double size).
ZeroBasedDistance = Linear change in distance (0 = no change, 10 = 10 pixel larger radius, -10 = 10 pixel smaller radius).
The swipe delta will be multiplied by this value.
This event is invoked when the requirements are met.
Float = Pinch value based on your Scale setting.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually add a finger.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually remove a finger.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually remove all fingers.
This component allows you to perform a continuous action based on the current position of the fingers relative to where they started.
This allows you to perform actions like an invisible joystick.
The method used to find fingers to use with this component. See LeanFingerFilter documentation for more information.
The coordinate space of the OnDelta values.
The delta values will be multiplied by this when output.
If you enable this then the delta values will be multiplied by Time.deltaTime. This allows you to maintain frame rate independent actions.
This event is invoked when the requirements are met.
Vector2 = Position Delta based on your Delta setting.
Called on the first frame the conditions are met.
Float = The distance/magnitude/length of the swipe delta vector.
The method used to find world coordinates from a finger. See LeanScreenDepth documentation for more information.
Called on the first frame the conditions are met.
Vector3 = Start point in world space.
Called on the first frame the conditions are met.
Vector3 = End point in world space.
Called on the first frame the conditions are met.
Vector3 = The vector between the start and end points in world space.
Called on the first frame the conditions are met.
Vector3 = Start point in world space.
Vector3 = End point in world space.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually add a finger.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually remove a finger.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually remove all fingers.
This script calculates the multi-swipe event.
A multi-swipe is where you swipe multiple fingers at the same time, and OnSwipe gets called when the first finger is released from the screen.
The method used to find fingers to use with this component. See LeanFingerFilter documentation for more information.
Each finger touching the screen must have moved at least this distance for a multi swipe to be considered. This prevents the scenario where multiple fingers are touching, but only one swipes.
This allows you to set the maximum angle between parallel swiping fingers for the OnSwipeParallel event to be fired.
This allows you to set the minimum pinch distance for the OnSwipeIn and OnSwipeOut events to be fired.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually add a finger.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually remove a finger.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually remove all fingers.
This script calculates the multi-tap event.
A multi-tap is where you press and release at least one finger at the same time.
The method used to find fingers to use with this component. See LeanFingerFilter documentation for more information.
Called when a multi-tap occurs.
Called when a multi-tap occurs.
Int = The amount of times you've multi-tapped.
Called when a multi-tap occurs.
Int = The maximum amount of fingers involved in this multi-tap.
Called when a multi-tap occurs.
Int = The amount of times you've multi-tapped.
Int = The maximum amount of fingers involved in this multi-tap.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually add a finger.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually remove a finger.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually remove all fingers.
This component allows you to get the twist of all fingers.
The method used to find fingers to use with this component. See LeanFingerFilter documentation for more information.
If there is no twisting, ignore the events?
Should this component allow one finger twisting?
ScreenCenter = The twist pivot point will be the center of the screen.
FingerStart = The twist pivot point will be the finger start position.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually add a finger.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually remove a finger.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually remove all fingers.
This component allows you to detect when a specific amount of fingers stop touching the screen.
The method used to find fingers to use with this component. See LeanFingerFilter documentation for more information.
This event will be called if the above conditions are met when your finger stops touching the screen.
The method used to find world coordinates from a finger. See LeanScreenDepth documentation for more information.
This event will be called if the above conditions are met when your finger stops touching the screen.
Vector3 = Finger position in world space.
This event will be called if the above conditions are met when your finger stops touching the screen.
Vector2 = Finger position in screen space.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually add a finger.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually remove a finger.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually remove all fingers.
This component allows you to get the change in position of all specified fingers.
The method used to find fingers to use with this component. See LeanFingerFilter documentation for more information.
If the fingers didn't move, skip calling
This event is invoked when the requirements are met.
List
The coordinate space of the OnDelta values.
Should the delta values be locked to the horizontal or vertical axes?
HorizontalOrVertical1 = This component won't output any delta until the finger(s) have moved more than Threshold scaled pixels.
HorizontalOrVertical2 = This component will output normal delta values until the finger(s) have moved more than Threshold scaled pixels.
This finger(s) must move this many scaled pixels for the constraint to begin.
The delta values will be multiplied by this when output.
This event is invoked when the requirements are met.
Vector2 = Position Delta based on your Delta setting.
Called on the first frame the conditions are met.
Float = The distance/magnitude/length of the swipe delta vector.
The method used to find world coordinates from a finger. See LeanScreenDepth documentation for more information.
Called on the first frame the conditions are met.
Vector3 = Start point in world space.
Called on the first frame the conditions are met.
Vector3 = End point in world space.
Called on the first frame the conditions are met.
Vector3 = The vector between the start and end points in world space.
Called on the first frame the conditions are met.
Vector3 = Start point in world space.
Vector3 = End point in world space.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually add a finger.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually remove a finger.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually remove all fingers.
This component allows you to perform events while fingers are on top of the current UI element.
If a finger is currently off the current UI element, ignore it?
This component can be used to pick objects in your scene that have the LeanPickable component attached.
The tag required for an object to be selected.
This event will be invoked when an object is picked.
This method allows you to pick at the finger's StartScreenPosition.
This method allows you to pick at the finger's current ScreenPosition.
This method allows you to initiate selection of a finger at a custom screen position.
This component allows you to detect when a finger presses/taps on top of the current GameObject without using the LeanSelectable system.
This event will be invoked when the specified finger touches this GameObject.
The method used to find world coordinates from a finger. See LeanScreenDepth documentation for more information.
This event will be invoked when this object is picked, and tell you the world space position it touched.
This event will be invoked when this object is picked, and tell you the screen space position it touched.
This component allows you to zoom a camera in and out based on the pinch gesture
This supports both perspective and orthographic cameras
The method used to find fingers to use with this component. See LeanFingerFilter documentation for more information.
The camera this component will calculate using.
None = MainCamera.
The current FOV/Size.
If you want this component to change smoothly over time, then this allows you to control how quick the changes reach their target value.
-1 = Instantly change.
1 = Slowly change.
10 = Quickly change.
Limit the FOV/Size?
The minimum FOV/Size we want to zoom to.
The maximum FOV/Size we want to zoom to.
Should the zoom be performed relative to the finger center?
Ignore changes in Z translation for 2D?
The method used to find world coordinates from a finger. See LeanScreenDepth documentation for more information.
This method allows you to multiply the current Zoom value by the specified scale. This is useful for quickly changing the zoom from UI button clicks, or LeanMouseWheel scrolling.
This method allows you to multiply the current Zoom value by the specified delta. This works like MultiplyZoom, except a value of 0 will result in no change, -1 will halve the zoom, 2 will double the zoom, etc.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually add a finger.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually remove a finger.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually remove all fingers.
This shows you how to record a finger's movement data that can later be replayed.
The cursor used to show the recording.
The conversion method used to find a world point from a screen point.
Is the recording playing?
The position of the playback in seconds.
This component shows you a basic implementation of a block in a match-3 style game.
Current X grid coordinate of this block.
Current Y grid coordinate of this block.
The size of the block in world space.
Auto deselect this block when swapping?
If you want this component to change smoothly over time, then this allows you to control how quick the changes reach their target value.
-1 = Instantly change.
1 = Slowly change.
10 = Quickly change.
This component can calculate the average position of all selected objects in the scene.
This allows you to output Seconds to UI text.
This method will calculate the position and output it using the OnPosition event.
This script allows you to twist the selected object around like a dial or knob.
The camera this component will calculate using.
None/null = MainCamera.
The base rotation in local space.
The axis of the rotation in local space.
The angle of the dial in degrees.
Should the Angle value be clamped?
The minimum Angle value.
The maximum Angle value.
This allows you to perform a custom event when the dial is within a specified angle range.
This event is invoked when the Angle changes.
Float = Current Angle.
This method allows you to increase the Angle value from an external event (e.g. UI button click).
This script will add torque to the attached Rigidbody based on finger spin gestures.
The camera this component will calculate using.
None/null = MainCamera.
The torque force multiplier.
This script allows you to change the color of the SpriteRenderer attached to the current GameObject.
When this object is dropped, should its GameObject layer be temporarily switched to IgnoreRaycast, so the drop can pass through it?
None = Make no changes.
ThisGameObject = Change this GameObject's layer only.
ThisGameObjectAndAncestors = Change this GameObject and its ancestors's layers.
Called on the first frame the conditions are met.
GameObject = The GameObject instance this was dropped on.
Called on the first frame the conditions are met.
IDropHandler = The IDropHandler instance this was dropped on.
This component scales the current selectable based on the selecting finger pressure.
The default scale with no pressure.
The amount BaseScale gets multiplied based on the finger pressure.
Limit pressure to a range of 0..1?
This component fires events when the selectable has been selected for a certain amount of time.
The finger must be held for this many seconds.
When should Seconds be reset to 0?
Bypass LeanSelectable.HideWithFinger?
If the selecting finger went up, cancel timer?
Called on the first frame the conditions are met.
Called on every frame the conditions are met.
Called on the last frame the conditions are met.
This component counts how many seconds this LeanSelectable has been selected and sends it out via event.
This allows you to control when the events will be invoked.
WhileSelected = Every frame while this object is selected.
WhileSelectedAndWhenDeselected = Every frame while this object is selected, and the first frame it gets deselected.
Always = Every frame, regardless of the selection.
Based on the Send setting, this event will be invoked.
Float = Seconds selected.
This component will draw a selection box.
The camera this component will calculate using.
None/null = MainCamera.
Ignore fingers with StartedOverGui?
The selection box prefab.
The transform the prefabs will be spawned on.
The selected objects will be selected by this component.
For an object to be selected, it must be in one of these layers.
For an object to be selected, it must have one of these tags.
This component allows you to define a shape using 2D points.
Should the start and end points of this shape be connected, forming a loop?
If you want to visualize the shape, you can specify an output LineRenderer here.
The points that define the shape.
This component allows you to detect
The method used to find fingers to use with this component. See LeanFingerFilter documentation for more information.
The shape we want to detect.
The finger must move at least this many scaled pixels for it to record a new point.
The drawn shape must be within this distance of the reference shape to be recognized. This is in local space relative to the reference shape.
If you draw outside the DistanceThreshold, the error factor will increase based on how far you stray, until eventually the shape fails to detect. This allows you to set how high the error factor can become before the detection fails.
If you want to allow partial shape matches, then specify the minimum amount of edges that must be matched in the shape.
Which direction should the shape be checked using?
If the finger goes up and it has traced the specified shape, this event will be invoked with the finger data.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually add a finger.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually remove a finger.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually remove all fingers.
This component allows you to spawn a prefab at a point relative to a finger and the specified ScreenDepth.
The prefab that this component can spawn.
How should the spawned prefab be rotated?
Hold on to the spawned clone while the spawning finger is still being held?
If the spawned object is dropped on top of the wrong GameObject (e.g. UI), destroy it?
If the spawned object isn't dropped on top of the specified GameObjects, destroy it?
If the specified prefab is selectable, select it when spawned?
If you want the spawned component to be a selected with a specific select component, you can specify it here.
None/null = It will be self selected.
If the selecting finger goes up, deselect the object?
The conversion method used to find a world point from a screen point.
This allows you to offset the finger position.
If you want the pixels to scale based on device resolution, then specify the canvas whose scale you want to use here.
This allows you to offset the spawned object position.
This allows you transform the WorldOffset to be relative to the specified Transform.
This will spawn Prefab at the specified finger based on the ScreenDepth setting.
This component allows you to detect when a finger swipes from the edge of the screen.
The method used to find fingers to use with this component. See LeanFingerFilter documentation for more information.
Detect swipes coming from the left edge?
Detect swipes coming from the right edge?
Detect swipes coming from the bottom edge?
Detect swipes coming from the top edge?
If the swipe angle is off by this many degrees, it will be ignored.
0 = Must be exactly parallel.
The swipe must begin within this many scaled pixels of the edge of the screen.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually check for a swipe.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually add a finger.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually remove a finger.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually remove all fingers.
This component allows you to rotate the current GameObject using a twist gesture.
The method used to find fingers to use with this component. See LeanFingerFilter documentation for more information.
If you want this component to change smoothly over time, then this allows you to control how quick the changes reach their target value.
-1 = Instantly change.
1 = Slowly change.
10 = Quickly change.
Should the rotation be performed relative to the finger center?
The method used to find world coordinates from a finger. See LeanScreenDepth documentation for more information.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually add a finger.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually remove a finger.
If you've set Use to ManuallyAddedFingers, then you can call this method to manually remove all fingers.