What do you want to achieve? I would like to be able to detect when the position of the player’s finger has moved on the screen, and depending on its movement I would put an action for the player. But unfortunately I don’t have any idea how to detect the change of the finger position from the moment when the interaction with the screen started to the moment when the player moved his finger on the screen. If I have misunderstood I can rephrase my problem. For more information you have a part of my script below, I don’t know if this is the right way to reach the solution. Thanks
What is the issue?
userInputService.TouchStarted:Connect(function(Position1, gameProcessed)
print("Player Touch The Screen With Finger"..tostring(Position1.Position))
--EXEMPLE IF IT DO IN POSITION1(X,Y,100)
userInputService.TouchMoved:Connect(function(Position2, gameProcessed)
print("Player Move Is Finger On The Screen"..tostring(Position2.Position))
--THEN IF IT DO IN POSITION2(X,Y, +200 (so 300)) then i can put an action
end)
end)
Why are you running this inside RenderStepped? You don’t need it at all…
userInputService.TouchStarted:Connect(function(Position1, gameProcessed)
print("Player Touch The Screen With Finger"..tostring(Position1.Position))
end)
userInputService.TouchMoved:Connect(function(Position2, gameProcessed)
print("Player Move Is Finger In The Screen"..tostring(Position2.Position))
end)
I did this to combine the two actions into one, because I think I will need it to interact between the two functions. Unfortunately your answer has no link with my probem
You don’t need it even to combine the two actions, neither to run them inside each other. Could you explain your problem further, had a hard time understanding it.
userInputService.TouchStarted:Connect(function(Position1, gameProcessed)
print("touchok")
userInputService.TouchMoved:Connect(function(Position2, gameProcessed)
print("Moveok")
if Position2 == Position1 * --Something but idk what ? then
print("hi")
end
end)
end)