Hello! I’m trying to make a shooting system. I added mobile support, but with UserInputType Touch, when I rotate the camera, it shoots. I don’t want complex systems, just a simple game.
My code is:
(...)
local function shoot()
(...)
end
UserInputService.InputBegan:Connect(function(input, gameProcessedEvent)
if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch and not gameProcessedEvent and equipped and tool.Enabled then
shoot()
end
end)
tool.Unequipped:Connect(function()
mouse.Icon = offIcon
equipped = false
end)
tool.Equipped:Connect(function()
mouse.Icon = onIcon
equipped = true
end)