print((Vector2.new(script.Parent.Frame.Position) - Vector2.new(script.Parent.hi.Position)).magnitude)
It just returns 0, even though the 2 frames are far from eachother.
print((Vector2.new(script.Parent.Frame.Position) - Vector2.new(script.Parent.hi.Position)).magnitude)
It just returns 0, even though the 2 frames are far from eachother.
You don't need the Vector2.new part, as you're just subtracting one already-built vector2 from another.
print((script.Parent.Frame.Position -script.Parent.hi.Position).magnitude)
This discussion is preserved as it was. New answers, comments, and votes are closed.
3 comments
GUI Frames positions are UDdim2 values, not Vector2 values
What do you use vector2 for then?
yah, what the king said is right, Vector2.new() has only 2 arguments and they are x and y. while Udim2 has an offset and a scale for each x and y, so it has 4args. and i''m assuming the vector 2 just took the scale which im assuming you werent using so it was 0 for both x and y, and thats why the magnitude was 0. All though my expectation might be wrong