Pinch Gesture Value jumps between the 1st and 2nd Pinch Event

Reproduction Steps

Create a new project and set it up to print out every Pinch Value for the Pinch Gesture Event to the Screen and to the Log. Then play the game on a Touch Screen Device (I am using an Android phone, but it shouldn’t make a difference). Touch the screen with just 1 finger and move it a fair bit across the screen. Then touch the screen with a 2nd finger.

Result

The first pinch value is 1, but the second value is very different, depending on how you moved your finger. All subsequent values are very close to the second value. This is the case even if you don’t pinch your fingers.

Expected

All values are almost equal to each other, if the fingers are not pinched.

Hello AllJonasNeeds,

I was unable to reproduce this on our end. I have a few questions for you that will help narrow down what issue it is that you are experiencing.

Quick questions:

  1. Can you reproduce this issue in a clean project in the latest release of the engine?
  2. If so, could you provide a detailed of steps to reproduce this issue on our end?
  3. Could you provide screen shots of any settings/blueprints that may be involved?

Hi ,

I am sorry I didn’t provide detailed instructions the first time around. I just tested the bug again, this time with 4.16.2 instead of 4.15 and with a clean project. Here are the more detailed reproduction steps:

Reproduction Steps

Create a new Blueprint Project

In the Project settings under Input add an Axis Mapping for the Pinch key and name it “PinchAxis” or whatever you want.

Also set the Default Touch Interface to None.

Create a PlayerController Blueprint and add an Axis Event node for the Axis Mapping to the Event Graph.

Connect the Axis Event’s execution pin to a Print String node and the “Axis Value” pin to the “In String” pin.

Create a Gamemode Blueprint to select your PlayerController BP.

In Project Settings → Maps & Modes select your Gamemode Blueprint as the Default GameMode and Template_Default as the Game Default Map.

Package the Project to test it out on your mobile phone and start the app once it is installed on your phone.

Start touching your phone near the edge of the screen with one finger.

Move that finger towards the middle of the screen without lifting your finger.

Touch the your phone on the opposite side of the screen with a 2nd finger without lifting the first finger.

Try to lift your fingers without moving and exit the app.

Locate the log file on your phone to see the result.

Result

The Pinch Value is 0.0 until the second finger touches, at which point the value is 1.0 for the first frame. After that the value is somewhere above 1.5 or below 0.5 until the fingers are lifted.

Expected

I would expect, that the value does not jump to a different number on the frame after the second finger touches. I would either expect the number to be something like 1.5 or 0.5 on the first frame, or I would expect the number to be something like 1.05 or 0.95 on the second frame.

Example Log

...

[2017.07.25-18.13.41:472][  0]LogBlueprintUserMessages: 
[BP_MyPlayerController_C_0] 0.0

[2017.07.25-18.13.41:490][  0]LogBlueprintUserMessages: [BP_MyPlayerController_C_0] 0.0

[2017.07.25-18.13.41:509][  0]LogBlueprintUserMessages: [BP_MyPlayerController_C_0] 1.0

[2017.07.25-18.13.41:529][  0]LogBlueprintUserMessages: [BP_MyPlayerController_C_0] 0.338245

[2017.07.25-18.13.41:546][  0]LogBlueprintUserMessages: [BP_MyPlayerController_C_0] 0.33759

...

And here is a screenshot of my PlayerController’s Event Graph

192642-unbenannt.png

Thank you for the additional information. However, it appears to be working as intended on our end. Is it possible that your fingers have moved slightly after touching the screen? Keep in mind that the starting distance between your fingers will determine the scale at which the number from the axis will change. For example, if you start with your fingers close together, smaller movement will make a bigger difference than if you were to start with you fingers further a part.

As you can see from the last 5 reproduction steps, moving the first finger before the second finger touches the screen is exactly what I have done.

I would like to point out that various play tests have shown that this behavior is pretty common for my project. (I am using the Pinch Gesture to zoom and normal dragging to move the camera in my game.)

I still think the behavior is unexpected, but I respect your opinion and decision on the issue.

If anyone in the future is looking for a workaround for their project, I was able to solve the problem in my game by ignoring the Input if the Axis Value is equal to 1.0

Thank you, for investigating the issue and have a great day :slight_smile:

I am happy to hear that you have found a workaround for the intended behavior that you are looking for. I will be converting my previous comment to an answer. However, if you have more information at any point as to this needing to be a bug report. Please feel free to reopen this thread with a reply and I will be happy to take a look.

Hi , I found this thread after trying to fix the same issue I’ve been having.

To reproduce, I’ve set up an UE4 project “pinch bug demonstrator” that you can find here:

  1. Deploy this to an android device.
  2. Then put first finger on the screen,
  3. Then place a second finger on the screen.
  4. Then move your second finger towards or away your first finger so that the numbers gets ridiculously big or ridiculously small. (around 0.1 small or 50+big)
  5. Lift your second finger, then place it back.

What should be the expected pinch axis value on this? One might expect the pinch axis value to reset to 1.0 (or due to hand movement margin of error, jitters around 0.9xxx and 1.xxx or something). When you do this test repeatedly, the numbers will jump around depending on whether you increase or decrease the distance of your fingers during your pinch.

I was unable to cleanly workaround this issue by ignoring the Input if axis value is equal to 1.0 as the other user has stated, and instead had to workaround by disabling pinch ability when the second finger is released until the first finger is released, and only then pinch ability is enabled again.