Hi,
So my button effect module was working fine, but recently i checked my old game that use it and… boom it don’t work properly!
So firstly in local script i require module script with my effect function then i do:
ButtonEffect(Button1)
ButtonEffect(Button2)
ButtonEffect(Button3)
--etc...
Then in module it do some math:
local appearance = button
local backdrop = appearance:WaitForChild("3d")
local origin, origin2, speed = button.Position, backdrop.Position, 0.05
local pos = backdrop.AbsolutePosition - button.AbsolutePosition
local distance = UDim2.new(0, pos.X, 0, pos.Y)
print(
tostring(distance).." / "..backdrop.AbsolutePosition.X.." / "..button.AbsolutePosition.X.." / "..
backdrop.AbsolutePosition.Y.." / "..button.AbsolutePosition.Y.." / "..
button.Name
)
What print is printing:
This is how button look like:
As you can see pos is subtract of AbsolutePosition of backdrop (dark blue thing in image) and button and it supposed to be around {0, 11}, but somehow it getting into {-285, -44}. I have no idea what wrong, since i crearly see that X AbsolutePosition is the same and should be 0, but it becomes a -285 ???
NOTE: when i do:
ButtonEffect(Button1)
ButtonEffect(Button2)
ButtonEffect(Button3)
--etc...
ONLY First function (Button1 one) will have this problem and others that are below it will be fine! And if i change positions like this:
ButtonEffect(Button3)
ButtonEffect(Button1)
ButtonEffect(Button2)
--etc...
Then now Button3 will have problems and others will not!
So is this roblox problem or i do something wrong?