Get the distance of a touch while touch phase is moved
Hello,
i'm really stuck with the problem i mentioned above. I want to get the distance of the touch while the touch phase is moved and the finger is continually on the screen. The direction is redundant. The function should work like this:
while the touch phase is moved and the touch distance is > 5 do something...
You can check the it by registering two vectors. Save a vector position when the touch begins and save another vector position when the touch phase has moved. find the distance between the two vectors.
Answer by hexagonius · Jan 25, 2016 at 07:14 AM
The touch has a deltaPosition. It's kind of a local position as if the fingers most recent position were relative to 0,0,0. the magnitude is the distance, accumulate it.
http://docs.unity3d.com/ScriptReference/Touch-deltaPosition.html
DUDE YOU'RE ABSOLUTELY A$$anonymous$$AZING. I've been looking for a solution for so long :')
Answer by damir_2009 · Oct 22, 2021 at 01:42 PM
Hi Im kinda a beginner and I want to know how to calculate the distance when u press with 2 fingers to calculate the distance between the two fingers thanks so much