I have a frame that when you click on it (via MouseButton1Click
), it will change the active
variable, and open a panel.
However, when I switch to a mobile device the clicks don’t register for some reason. I have tried using Enum.UserInputType.Touch
but instead of when the frame is tapped, when the frame is being hovered the active
variable is set to true and the panel will open.
Whenever the Dynamic Thumbstick sometimes hovers over the frame, the same thing will happen.
How do I make it so the active
variable changes when the frame is being tapped and not hovered on mobile?
--this is a localscript
local Frame = script.parent
local active = false
Frame.InputBegan:Connect(
function(InputObject)
if InputObject.UserInputType == Enum.UserInputType.MouseButton1 then
if active == true then
active = false
elseif active == false then
active = true
end
end
end
)