Hello, so I’ve been trying to tween the CanvasPosition of my ScrollingFrame whenever I click on a specific button, however, It’s not working at all, even if I didn’t use tweening, it would work but would not be the same position of different devices.
If you’re interested about my script, here it is:
-- // VARIABLES \\ --
local __TWEENSERVICE__ = game:GetService("TweenService");
local __FRAME__ = script.Parent.Parent;
local __SCROLLER__ = __FRAME__.ScrollingFrame;
local __BUTTON__ = __FRAME__.__CASH__;
-- // MAIN \\ --
__BUTTON__.MouseEnter:Connect(function()
local __1__ = __TWEENSERVICE__:Create(__BUTTON__.UIScale,TweenInfo.new(0.55,Enum.EasingStyle.Elastic),{Scale = 1.15});
__1__:Play()
local __2__ = __TWEENSERVICE__:Create(__BUTTON__,TweenInfo.new(0.55,Enum.EasingStyle.Elastic),{Rotation = -5});
__2__:Play()
end)
__BUTTON__.MouseLeave:Connect(function()
local __1__ = __TWEENSERVICE__:Create(__BUTTON__.UIScale,TweenInfo.new(0.55,Enum.EasingStyle.Elastic),{Scale = 1});
__1__:Play()
local __2__ = __TWEENSERVICE__:Create(__BUTTON__,TweenInfo.new(0.55,Enum.EasingStyle.Elastic),{Rotation = 0});
__2__:Play()
end)
__BUTTON__.MouseButton1Click:Connect(function()
local __1__ = __TWEENSERVICE__:Create(__BUTTON__.UIScale,TweenInfo.new(0.55,Enum.EasingStyle.Elastic),{Scale = 0.85});
__1__:Play()
task.wait(.1)
local __2__ = __TWEENSERVICE__:Create(__BUTTON__.UIScale,TweenInfo.new(0.55,Enum.EasingStyle.Elastic),{Scale = 1});
__2__:Play()
local __3__ = __TWEENSERVICE__:Create(__SCROLLER__,TweenInfo.new(0.25,Enum.EasingStyle.Sine),{CanvasPosition = Vector2.new(0,__SCROLLER__.AbsoluteWindowSize.Y*__FRAME__.Position.Y)*0.750});
__3__:Play()
end)