TouchMoved code sample won't work

Page link

The code sample should be changed from

local userInputService = game:GetService("UserInputService")
 
function(touch, gameProcessedEvent)
	local oldPosition = touch.Position - touch.Delta
	print("Touch moved from "..tostring(oldPosition).."to "..tostring(touch.Position))
end
 
userInputService.TouchMoved:Connect(TouchMoved)

to

local userInputService = game:GetService("UserInputService")
 
function TouchMoved(touch, gameProcessedEvent)
	local oldPosition = touch.Position - touch.Delta
	print("Touch moved from "..tostring(oldPosition).."to "..tostring(touch.Position))
end
 
userInputService.TouchMoved:Connect(TouchMoved)
2 Likes

I’ve fixed the code sample and made it consistent with the devhub code style. Thanks for the catch :slight_smile:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.