For some reason the frame isn’t cloning fast enough and it’s leaving gaps. Is there another way of doing this?
local replicatedStorage = game:GetService("ReplicatedStorage")
local userInputService = game:GetService("UserInputService")
local runService = game:GetService("RunService")
local players = game:GetService("Players")
local player = players.LocalPlayer
local mouse = player:GetMouse()
local drawings = script.Parent.Drawings
local mark = replicatedStorage:WaitForChild("Mark")
local press = false
local x
local y
userInputService.InputBegan:Connect(function(key, processed)
if processed then
return false
end
if key.UserInputType == Enum.UserInputType.MouseButton1 then
press = true
end
end)
userInputService.InputEnded:Connect(function(key, processed)
if processed then
return false
end
if key.UserInputType == Enum.UserInputType.MouseButton1 then
press = false
end
end)
runService.RenderStepped:Connect(function()
x = mouse.X / mouse.ViewSizeX
y = mouse.Y / mouse.ViewSizeY
if press == true then
local newMark = mark:Clone()
newMark.Position = UDim2.new(x, 0, y, 0)
newMark.Parent = script.Parent
end
end)