Is there another way to rotate a GUI Frame perfectly between two points?
I can't think of a way to explain it. I'm basically taking two points and connecting them using a GUI Frame. It's working for the most part, but it gets off course in it's X dimension more and more as I move the points away in their Y dimension.
The names of the functions in this snippet should explain what they do, I just don't want to paste a lot of code if not needed. If you think it's an issue with one of them, though, I'd be more than happy to paste the functions.
2 | m.AbsolutePosition = Vector 2. new( 0 , 0 ); |
3 | game:GetService( "RunService" ).RenderStepped:connect( function () |
4 | m.AbsolutePosition = Vector 2. new(mouse.X,mouse.Y); |
5 | connector.Size = UDim 2. new( 0 ,getDistance(a.AbsolutePosition,m.AbsolutePosition), 0 ,connectorWidth); |
6 | connector.Position = UDim 2. new( 0 ,getLeftMost(a.AbsolutePosition,m.AbsolutePosition).X, 0 ,(a.AbsolutePosition.Y+m.AbsolutePosition.Y)/ 2 ); |
7 | connector.Rotation = getAngleTo(a.AbsolutePosition,m.AbsolutePosition) * ( 180 /math.pi); |
Here's a GIF of what it's doing.