[Help, Script] UserInputService // Touch.Started , Touch.Moved

  1. 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

  2. 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)

UserInputService.TouchMoved - Read the documentation of TouchMoved & Started

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.

I would like to be able to detect when the player has moved his finger and the position has changed like for example :

Player touch screen : Position (AnyNumber,X,X)
Player moves his finger on the screen : New Position (-200,X,X)
then an action is produced

Player touches screen : Position (X,AnyNumber,X)
Player moves his finger on the screen : New Position (X,+200,X)
then an action is produced

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)

Maybe something like this… ?