I tried making a line that follows one point to your mouse, but it worked when i used it on two parts but because the center of a gui is in the left corner it was very wierd. I have tried fixing in a multiple ways it but none worked.
mouse = script.Parent.Parent.Parent.Parent:GetMouse() node = script.Parent.Parent.Frame.Nodein1 line = script.Parent function move() local x1 = node.AbsolutePosition.X+25 local y1 = node.AbsolutePosition.Y+25 local x2 = mouse.X local y2 = mouse.Y local deg = math.atan2(y1-y2,x1-x2)*180.0/math.pi line.Size = UDim2.new(0,math.sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)),0,10) line.Position = UDim2.new(0,(x1+x2)/2-5,0,(y1+y2)/2-5) line.Rotation = deg print(deg) end mouse.Move:connect(move)
I already had a problem similar to yours and it seems like you can't do maths with UDim2 you would more need to use the tweenposition instead of math.If you have any question comment my answer and i will respond to you as fats as i can.Hope i helped you! ;)
link: http://wiki.roblox.com/index.php?title=API:Class/GuiObject/TweenPosition