I am trying to make a custom second joystick for mobile. I want to make my image button follow the players touch when they press and drag it. I don’t know where to start with this. Thanks
imageButton.InputBegan:Connect(function(inputObj: InputObject, gp)
if inputObj.UserInputType == Enum.UserInputType.Touch then
--make imageButton follow touch
end
end)
imageButton.InputChanged:Connect(function(inputObj : InputObject, gp : boolean)
if gp then
return
end
if inputObj.UserInputType == Enum.UserInputType.Touch then
local touchPosition = inputObj.Position
imageButton.Position = UDim2.new(0, touchPosition.X-36, 0, touchPosition.Y-36)
end
end)