#Touch detection in mobile

1 messages · Page 1 of 1 (latest)

spiral wraith
#

Hi guys so example i have a snowball tool ( example only ) when i'm using mobile ofcourse I'll touch the screen and throw a snowball on it. How to make like when I'm moving and touching the joystick, it didn't interrupt my another touch cuz when im touch it both, it's like the snowball going to where my joystick touch is

#

can anyone save my game

turbid token
#

Code?

spiral wraith
turbid token
#

You are using UserInputService?

#

I think just checking if not processed as parameter good

#

Not understand, google the keywords in my sentence

cyan copper
#
local UserInputService = game:GetService("UserInputService")


UserInputService.TouchTap:Connect(function(touchPositions, processedByUI)

    if processedByUI then return end

    --Code here

end)

Does your code look like this?

spiral wraith
#

no, it just about mousehit

spiral wraith
#

like mousehit.position

turbid token
#

No

#

Touch

#

Mouse

#

Difference

spiral wraith
#

so if it's touch, how to make it

spiral wraith
#

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local mouse = player:GetMouse()

script.Parent.Activated:Connect(function()
local mouseHit = mouse.Hit
script.Parent.Throw:FireServer(mouseHit)
end)