Only need to worry about line 23
local TweenService = game:GetService("TweenService")
script.Prev.Value = "Ref"
script.Parent.Ping.Changed:Connect(function()
local CurrentPosition = Vector2.new(0, 1 - (script.Parent.Ping.Value / 500))
print("CP_: " .. tostring(CurrentPosition))
local PrevPosition = Vector2.new(script.Parent.Plots[script.Prev.Value].Position.X.Scale, script.Parent.Plots[script.Prev.Value].Position.Y.Scale)
print("PP_: " .. tostring(Vector2.new(script.Parent.Plots[script.Prev.Value].Position.X.Scale, script.Parent.Plots[script.Prev.Value].Position.Y.Scale)))
local DataPoint = script.LineSegment:Clone()
DataPoint.Position = UDim2.new(1, 0, 1 - (script.Parent.Ping.Value / 500), 0)
DataPoint.Parent = script.Parent.Plots
DataPoint.BackgroundTransparency = 1
DataPoint.Name = "Plot" .. script.Num.Value
script.Prev.Value = DataPoint.Name
local LineSegment = script.LineSegment:Clone()
LineSegment.Position = UDim2.new(1, 0, CurrentPosition.Y * 1, 0)
print("Pos: " .. tostring(UDim2.new(1, 0, CurrentPosition.Y * 1, 0)))
local Temp = (CurrentPosition - PrevPosition).Unit * -360
LineSegment.Rotation = Temp.Y
print("Rot: " .. tostring(Temp.Y))
LineSegment.Size = UDim2.new((CurrentPosition - PrevPosition).Magnitude, 0, 0, 2)
print("Siz: " .. tostring((CurrentPosition - PrevPosition).Magnitude))
LineSegment.Parent = script.Parent.Plots
LineSegment.Name = "LineSegment" .. script.Num.Value
script.Num.Value = script.Num.Value + 1
local goal = {}
goal.Position = UDim2.new(0, 0, 1 - (script.Parent.Ping.Value / 500), 0)
local tweenInfo = TweenInfo.new(script.Parent.Speed.Value, 0)
local tween1 = TweenService:Create(DataPoint, tweenInfo, goal)
local tween2 = TweenService:Create(LineSegment, tweenInfo, goal)
tween1:Play()
tween2:Play()
wait(script.Parent.Speed.Value)
DataPoint:Destroy()
wait(0)
LineSegment:Destroy()
end)
I have asked this question already and was told to multiply the magnitude by the max magnitude. I have no idea what max magnitude is. Could someone explain it to me like I know nothing about vectors?
In case there is a different answer ill reiterate my original question, I want to get the distance, in scale, between two GUI objects. When I run this though it gives me results nowhere close to what I'm expecting. What am I doing wrong?
Here is the Results

2 comments
isnt vector for physical things cuz thats all i know about it
@speedyfox66 your thinking of Vector3, which you are correct about, im talking about Vector2