So I'm making this Tug o' war minigame for my 2D Gui and I have encountered my first problem. I'm trying to make it so if middle of my rope (which is also a frame) hits the left or right side of the Gui (which are also Frame's); and I don't exactly know on how to do this.. I tried
if script.Parent.left.MIDDLE.Position.X>=script.Parent.Parent.right.Position.X then print(script.Parent.Parent.Parent.Parent.Parent.Name.." wins!") end
Keep in mind that I just started to learn on how to script Gui's.. help would be appreciated ;)
GUIs don't have normal position like parts, instead of using Vector3 use UDim2. For example:
Frame.Position = UDim2.new(0,50,0,50)
So try this:
if script.Parent.left.MIDDLE.Position.X.Offset>=script.Parent.Parent.right.Position.X.Offset then print(script.Parent.Parent.Parent.Parent.Parent.Name.." wins!") end
You need to edit this.
Hope it helps.
I found these two articles on the wiki which may help.