Hi!
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.
Tried again with two new frames.
innerFrame had the Active property set to false and outerFrame had the Active property set to true.
Still, doesn’t work for me.
That’s really odd, and there’s no other Frame/GUI element in the ScreenGUI, just those two? If so, this issue might be specific to your device. If you didn’t already, I would try this in a new empty baseplate just to confirm.