What do you want to achieve? Keep it simple and clear!
Make gun not fire when moving the screen on mobile.
What is the issue? Include screenshots / videos if possible!
The “Button1Down” event doesn’t recognize dragging.
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
None.
Code for firing:
Mouse.Button1Down:Connect(function()
MainModule.ButtonDown(Settings, Clone, Character, Mouse, Camera ) -- this has a module that sets "MouseDown" to true
end)
Mouse.Button1Up:Connect(function()
MainModule["MouseDown"] = false
end)
you could make it so if the mouse moves a certain amount after mouse down (player holding finger), it will not shoot since that means the player is dragging their finger. but if the mouse doesn’t move much, it will count as the player not dragging and when the player releases their finger, mouse up, it will shoot.
i hope this makes sense for you (as you can tell i’m not that good at explaining)
I tried that, but then raycasting doesn’t work (Raycast needs Mouse Position and when you click the button the mouse position is the place where the user has clicked).