Touch Gesture – Unreal Engine Asset Documentation

What Is Touch Gesture?

Touch Gesture is an Unreal Engine asset that provides easy access to touch gesture functionalities, allowing developers to easily implement touch gestures like swiping, transformation, location, rotation, and scaling in their projects. You can refer to the Touch Gesture Tutorial video for more details on setting up and using these features.

Touch Gesture Functionalities:

1. Touch Gesture Swipe

Swipe gestures can be recognized in the following directions:

  • Left
  • Right
  • Up
  • Down

2. Touch Gesture Transformation

Touch Gesture Transformation includes:

  • Location
  • Rotation
  • Scale

3. Touch Gesture Location

Location gestures can be recognized in:

  • One Finger Gesture: X, Y, Z
  • Two Finger Gesture: XY, xZ, YZ

4. Touch Gesture Rotation

Rotation gestures can be recognized in:

  • One Finger Gesture: Roll, Pitch, Yaw
  • Two Finger Gesture: YawAndPitch, YawAndRoll, PitchAndRoll

5. Touch Gesture Scale

Scaling can be done in:

  • One Finger Gesture: XYZ, X, Y, Z
  • Two Finger Gesture: XY, xZ, YZ

Touch Gesture Swipe

You can refer to the Touch Gesture Tutorial video for more details.

How to Use Touch Gesture Swipe:

  1. Step 1: Add the Touch Gesture Swipe component to any class.
  2. Step 2: Drag the Touch Gesture Swipe component to the Event Graph (or any other graph). Bind the event of the swipe direction you want to check (e.g., Left, Right, Up, or Down).

Features:

  • Prints the swipe direction to demonstrate functionality. You can replace the print statement with your custom code.
  • Easy to use with four directional swiping gestures: Left, Right, Up, and Down.

Touch Gesture Transformation

You can refer to the Touch Gesture Tutorial video for more details.

How to Use Touch Gesture Transformation:

  1. Step 1: Add the Touch Gesture Transformation component to any class.
  2. Step 2: Provide an actor that you want to transform (e.g., move, rotate, or scale).
  3. Step 3: To handle pinch gestures for scaling, add a pinch input in project settings and pass the pinch value to the component.

Setting Up Pinch Input:

  1. Go to Edit > Project Settings > Input.
  2. Add a new axis mapping (name it anything you like, e.g., PinchInput) and assign the pinch gesture value.

Transformation Types:

  • Location: Move objects in 1D (X, Y, Z) or 2D (XY, xZ, YZ).
  • Rotation: Rotate objects in 1D (Yaw, Pitch, Roll) or 2D (YawAndPitch, YawAndRoll, PitchAndRoll).
  • Scale: Scale objects in 1D (X, Y, Z) or 2D (XY, xZ, YZ) or uniformly (XYZ).

Touch Gesture Location

You can refer to the Touch Gesture Tutorial video for more details.

How to Use Touch Gesture Location:

  1. Step 1: Add the Touch Gesture Location component to any class.
  2. Step 2: Provide an actor that you want to move (change its location).

Location Types:

  • Move objects along one axis (X, Y, Z).
  • Move objects along two axes (XY, xZ, YZ).

Touch Gesture Rotation

You can refer to the Touch Gesture Tutorial video for more details.

How to Use Touch Gesture Rotation:

  1. Step 1: Add the Touch Gesture Rotation component to any class.
  2. Step 2: Provide an actor that you want to rotate.

Rotation Types:

  • Yaw (X axis)
  • Pitch (Y axis)
  • Roll (Z axis)
  • Two-finger gestures:
    • YawAndPitch (XY plane)
    • YawAndRoll (XZ plane)
    • PitchAndRoll (YZ plane)

Touch Gesture Scale

You can refer to the Touch Gesture Tutorial video for more details.

How to Use Touch Gesture Scale:

  1. Step 1: Add the Touch Gesture Scale component to any class.
  2. Step 2: Provide an actor that you want to scale.
  3. Step 3: To handle pinch gestures for scaling, add a pinch input in project settings and pass the pinch value to the component.

Scale Types:

  • One Finger Gesture: Scale uniformly (XYZ) or along specific axes (X, Y, Z).
  • Two Finger Gesture: Scale along two axes (XY, xZ, YZ).

Setting Up Pinch Input:

  1. Go to Edit > Project Settings > Input.
  2. Add a new axis mapping (name it anything you like, e.g., PinchInput) and assign the pinch gesture value.

Common Error Solution

You can refer to the Touch Gesture Tutorial video for more details.

Troubleshooting:

  • Transformation Actors: Ensure that transformation actors are movable if they are not already.
  • Gesture Recognizer: Enable the Gesture Recognizer in input settings.
  • Testing in Editor: Enable the “Use Mouse for Touch” setting in the editor for touch input testing.

With these features and setup steps, you can easily incorporate touch gestures into your Unreal Engine projects.