Currently, I am working on a dynamic crosshair that follows the mouse.
local Origin = script.Parent.Origin
local mousePos = game:GetService("UserInputService"):GetMouseLocation()
RunService.RenderStepped:Connect(function()
Origin.Position = UDim2.fromOffset(mousePos.X, mousePos.Y)
end)
But currently, having this code will only set Origin to be where it first finds the cursor, and stays there.
I have tried using Players.LocalPlayer:GetMouse(), but I can’t seem to remove the inset that makes Y go a bit higher than its supposed to.
local mouse = Players.LocalPlayer:GetMouse()
RunService.RenderStepped:Connect(function()
Origin.Position = UDim2.fromOffset(mousePos.X, mousePos.Y - Origin.AbsoluteSize.Y/2)
end)
Any idea how this can be fixed?

