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)
Before I try to answer I want to say I am on my phone so sorry if this is spelt weird or you see any spelling errors
The main issue I see right away is you’re using a very weird position for the gui object
Try:
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.X/ game.workspace.CurrentCamera.ViewportSize.X,0, mouse.Y/game.workspace.CurrentCamera.ViewportSize.Y,0) dot.Size = UDim2.new(0, 10, 0, 10) dot.Parent = game.StarterGui.ScreenGui.Frame end)