Trying to add mobile functionality to a hold and release tool and having issue with touchstarted.
I’m checking for the game processed event, but it still goes through even if I’m interacting with ingame UI.
Video for better explanation.
Essentially just want to be able to move without activating the tool
local function startInput(input,gpe)
if gpe then return end
if not Equipped then return end -- If the bow is not equipped, it disables the function
if not CanUse then return end
local Start = os.clock()
Event:FireServer(Character, Tool, "Load")
if Zooming then -- Stops other tweenings
Zooming:Cancel()
Zooming = nil
end
if Connection then -- Checks for connection bugs
Connection:Disconnect()
Connection = nil
end
local I = TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, 0, false, 0)
local G = {FieldOfView = 80}
Zooming = TweenService:Create(workspace.CurrentCamera, I, G)
Zooming:Play() -- Zooms out
Connection = RunService.RenderStepped:Connect(function(Elapsed) -- Will check progress and time elapsed
if not Equipped then return end
if os.clock() - Start > 0.01 then
if Progress < 100 then
Progress = Progress + 1
Start = os.clock()
elseif Progress < 0 then
Progress = 0
end
end
end)
end