Hey there,
I am trying to make a circle particle appear on my GUI button whenever I click on the exact position of the mouse however the circle appears to be in the incorrect position
I also got help from this topic to convert the Vector3 into UDim2
local players = game:GetService("Players")
local player = players.LocalPlayer
local mouse = player:GetMouse()
local camera = workspace.CurrentCamera
local viewportSize = camera.ViewportSize
mouse.Move:Connect(function()
print(mouse.X / viewportSize.X)
print((mouse.Y + 35) / viewportSize.Y)
end)
Bare in mind the legacy mouse object takes into account the GuiInset caused by Roblox’s top bar hence the addition of 35 to the mouse’s X position.