Errors in touchtap documentation

The provided code on this page has broken code listed as a example.

local function TouchTap(touch, gameProcessedEvent)
	touchGui.Parent = touchScreenGui
	touchGui.Position = UDim2.new(0, touch.Position.X, 0, touch.Position.Y)
	touchGui.Size = UDim2.new(0,50,0,50)
end

Taken directly from output, “touch” does not have the value of Position

Instead you need to do
touchGui.Position = UDim2.new(0, touch[1].X, 0, touch[1].Y)

1 Like

I’ve made the adjustment to the code sample and it works as expected now. Thanks for catching this! Should be visible soon.

1 Like

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