Touch event help !!!!!
im trying to make an effect activated by double click or swip from right to left
i tried
function onTapped(eventData)
{
}
var event = script.createEvent("TouchMoveEvent");
event.bind(onTapped);
but TouchMoveEvent not what i really need i wander if there is DoubleTapEvent ot SwipEvent to solve my prob
Thank you
Hey Just Me,
You're close. We can use the TouchStartEvent and the TouchEndEvent to track whether our finger has swiped left or right. Take a look at the script in this answer to detect different swipes: https://lensstudio.zendesk.com/hc/en-us/community/posts/360000718643/comments/360000189083
To check whether a double tap has occurred, we can similarly track TouchStartEvent. This time, however, we track whether we've tapped recently.
In the script below I put a reference to objectToToggle (in the object where this script is placed, in the Inspector panel, press the field "Object To Toggle" and select an object in the pop-up window). Then on the phone, when I double tap the screen, I am able to see the object toggle on and off.
Let me know if I can clarify anything. Can't wait to see what you come up with!
Cheers,
Jon