I’m having trouble with the exit of the TouchPan event on GuiObjects.
local frame = script.Parent local function onpan(touchPositions, totalTranslation, touchVelocity, state) if state.Name == "Begin" then print("touch begin") elseif state.Name == "Changed" then print("touch changed") elseif state.Name == "End" then --problem print("touch end") end end frame.TouchPan:connect(onpan)
The last UserInputState isn’t being fired for some reason.
I’m hoping someone can help me out.
Thanks in advance!
Edit: I came across a solution using another event. InputEnded.
local function oninputended(io) if io.UserInputType.Name == "Touch" then print("touch end") end end frame.TouchPan:connect(onpan) frame.InputEnded:connect(oninputended)
However, i’d like to see if you guys have a solution for the last statement in the
onpan function not being detected.