-
What do you want to achieve? Drawing a line from the bottom left corner being the origin.
-
What is the issue? The lines are rotated about 90 degrees.
-
What solutions have you tried so far? Ive tried adding 90 degrees, but it doesnt really work too well. It isn’t exact.
Here’s my code:
function drawLine(StartPoint, EndPoint, Color, Thickess, Parent)
local startX, startY = StartPoint.X, StartPoint.Y
local endX, endY = EndPoint.X, EndPoint.Y
local Line = Instance.new("Frame")
Line.AnchorPoint = Vector2.new(0.5, 0.5)
Line.BackgroundColor3 = Color
Line.BorderSizePixel = 0
Line.Size = UDim2.new(0, ((endX - startX) ^ 2 + (endY - startY) ^ 2) ^ 0.5, 0, Thickess)
Line.Position = UDim2.new(0, (startX + endX) / 2, 1, -(startY + endY) / 2)
Line.Rotation = math.atan2(endY - startY, endX - startX) * (180 / math.pi) -- This is where ive tried to add things.
Line.Parent = Parent
end
Give any help you can, im stuck.