I am trying to make a game were you add frames on click so once you click there will pop out a frame but once i click they intstence in diffrent position were i clicked
local mouse = player:GetMouse()
mouse.Button1Down:Connect(function()
local dot = Instance.new("Frame")
dot.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
dot.Position = UDim2.new(mouse.Y / 1000 ,0, mouse.X / 1000 ,0)
dot.Size = UDim2.new(0, 10, 0, 10)
dot.Parent = game.StarterGui.ScreenGui.Frame
end)

4 comments
This will get your screen size no matter the size and should place it in the right position, I also forgot to mention in the udim2 you had your X and Y mixed up
it shows me this error ViewportSizeX is not a valid member of Camera
@kristupas12344 change it to ViewportSize.X
My bad, was a mistake, i'll edit it to the correct thing