local mouse = game.Players.LocalPlayer:GetMouse()
local runService = game:GetService("RunService") -- get runservice before the loop
local function getPos()
while true do
print(yourGui.Position-mouse.Position) -- Change "yourGui" with your gui
runService.RenderStepped:Wait()
end
end
local mouse = game.Players.LocalPlayer:GetMouse()
local runService = game:GetService("RunService") -- get runservice before the loop
local function getPos()
while true do
print(script.Parent.Position-UDim2.new(0,mouse.X, 0,mouse.Y)) -- Change "yourGui" with your gui
runService.RenderStepped:Wait()
end
end
getPos()
Actually did mistake or i can’t be right (If you using GUi mouse position and not world mouse position then allright). You need mouse.Hit:
local mouse = game.Players.LocalPlayer:GetMouse()
local runService = game:GetService("RunService") -- get runservice before the loop
local function getPos()
while true do
print(script.Parent.Position-UDim2.new(0,mouse.Hit.p.X, 0,mouse.Hit.p.Y)) -- Change "yourGui" with your gui
runService.RenderStepped:Wait()
end
end
getPos()