ImageLabel is following the mouse with an offset

Hi. I have this kind of really weird issue with guis. So, I have a simple script, like this:

dragable.Position = UDim2.fromOffset(Mouse.X, Mouse.Y) -- dragable is an icon

and it should make icon follow the player mouse, but the problem is that it is following mouse with a really huge offset. Here’s the gif: https://gyazo.com/955131a512a66bde9b8e473adbacd87f
I set the AnchorPoint to 0.5,0.5, but it did nothing. The Size of it is Offset, but even if I set that to Scale, it doesn’t changes something. I don’t know why that happening, so if someone knows, please help, I will appreciate any answers.
Thanks!

Try doing draggable.Position = UDim2.new(Mouse.X, 0, Mouse.Y, 0)

UDim2.new sets the same position as the mouse but I think UDim2.fromOffset creates an offset from the mouse.

I tried both ways, it is the same thing.

It’s probably how you made the UI, what position and size did you set it as?

Oh, hold on. I just realized I was parenting that to my Inventory gui and since the Position is Scale it was wrong, Im sorry!

1 Like

The making of beeswarm simulator hahaha

1 Like