How do you find the magnitude between two frames inside an ScreenGui?
Asked by
8 years ago Edited 8 years ago
Using ROBLOX's WIKI page for magnitude I manged to make it work for bricks, now trying to find the magnitude between frames is not working as well :
WIKI :
(http://wiki.roblox.com/index.php?title=Magnitude)
WORKING CODE :
1 | local center = game.Workspace.center |
2 | local short = game.Workspace.short |
3 | local long = game.Workspace.long |
4 | local magnitude = (center.Position - short.Position).magnitude |
Now the working code is ONLY for the bricks, but I am trying to make this move over to a ScreenGUI + ImageButton.
Would I need to make my own Vector3 values in order to get the position, because using [(frame.Position - frame2.Position).magnitude] gives me an error
This leads me to that fact I need to get in individual values of the UDim2 properties, which I don't know how to do and that's why I came here.
ERROR :
magnitude is not a valid member, did you forget to capitalize the first letter?
13:30:37.945 - Script 'Players.Player1.PlayerGui.ScreenGui.ImageButton.Script', Line 5