game:GetService("UserInputService").InputChanged:connect(function(Input)
if Input.UserInputType == Enum.UserInputType.MouseMovement and Dragging == true then
inputPosition = UDim2.new(0, Mouse.X-25, 0, Mouse.Y-25)
end
end)
I even tried to set it too.
game:GetService("UserInputService").InputChanged:connect(function(Input)
if Input.UserInputType == Enum.UserInputType.MouseMovement and Dragging == true then
inputPosition = UDim2.new(0, Mouse.X, 0, Mouse.Y)
end
end)
And changing the pictures anchor points to .5,.5 but no matter what if your windows size is changed the image ends up on the wrong position.
InputPosition is the images position.
heres a gif of what it does https://gfycat.com/RecentDesertedJunco
and when I do change it to fit my screen if I make the window smaller it messes up. How do I fix it so it stays same place no matter window size

5 comments
mouse.Button1Down <-- use that mouse.Button1Down:Connect(function()
use :Connect() not :connect()
that will fix the problem
no
A D V I C E, also you could use UserInputService for detecting mouse input