UMG Pinch to scale

Hello,
We are currently working on a Multitouch application using UE4 and the UMG UI system and currently I am struggling with touch gestures.

I have multiple widgets on a large screen which one or more users should be able to move around or scale using a pinch gesture, no 3D scene, only UMG widgets.

Moving around the widget was no problem, I used the OnTouchStarted, OnTouchMoved and OnTouchEnded events. But now I dont know how to implement a pinch to scale/zoom function. I assume I have to use the pointer index and save it on touch started and then calculate the distance between two touch points, but how exactly can I implement this? Is this even the correct way or is there a better solution for this?

I suggest using a plugin to get you started with pinch scale gestures. There’s some out there that work, and It’ll likely save you a lot of time.

To manually calculate pinching, you’ll want to manage a list of touched down fingers and their positions, probably in a map then calculate percentage difference in vector distances from each other compared to their initial touch down distances.

I ended up using the plugin, it saves quite some time.