I have a UI drag detector trying to simulate a spinning lever. However, when I try dragging it, the pivot point seems to be slightly above the middle of the UI, rather than in the very center.
All of my UIs have their AnchorPoint set to 0.5,0.5 and the ReferenceUI of the drag detector is set to the center ImageLabel.
I’ve tried basically every setting, as well as using CustomOffset and adjusting the rotation via script, but the issue seems to be within the DragDetector. Any help would be appreciated!!
Okay, for anyone else who had this problem I found a workaround. Instead of using the “Rotate” DragStyle, I set it to TranslatePlane and set my ResponseStyle to CustomOffset. Then, in a script I manually calculated the degree using math.atan()
local degree = math.deg(math.atan2((dragdetector.DragUDim2.Y.Offset), (dragdetector.DragUDim2.X.Offset)))
mingameframe.ImageLabel.ImageLabel.Rotation = degree
No clue why the center of the ReferenceUI changes depending on whether you’re using Rotate or TranslatePlane, but here’s a solution nonetheless!