I don't know how I can move this back gui tweening

You can write your topic however you want, but you need to answer these questions:

So all I want is when I press the previous page button its going to tween all my shop templates back into their original space

the problem is when I tween it backwards I don’t know how I can tween it forward

local function lastmouse1down()
	Last.Visible = false 
	local endCrate = holder["Box"..8]
	
	for i,v in pairs(holder:GetChildren()) do 
		if v:IsA("Frame") then 
			local startX = v.AbsolutePosition.X + endCrate.AbsoluteSize.X/2 
			local endX = endCrate.AbsolutePosition.X + endCrate.AbsoluteSize.X/2 
			local xDiffrence = startX + endX
			local tweenInfo = TweenInfo.new(2.5, Enum.EasingStyle.Sine, Enum.EasingDirection.In)
			local landPosition = UDim2.new(xDiffrence)
			local tween = tweenService:Create(v, tweenInfo, {Position = landPosition})
			tween:Play()
		end
	end
end

local function nextmouse1down()
	print("test")
	local endCrate = holder["Box"..8/2]
	for  _,v in pairs(holder:GetChildren()) do 
		if v:IsA("Frame") then 
			local startX = v.AbsolutePosition.X + endCrate.AbsoluteSize.X/2
			local endX = endCrate.AbsolutePosition.X + endCrate.AbsoluteSize.X/2 
			local xDiffrence = endX - startX 
			local landPosition = Template.Position - UDim2.new(0, xDiffrence, 0, 0)
			local tweenTime = 2.5 
			local tweenInfo = TweenInfo.new(tweenTime, Enum.EasingStyle.Sine, Enum.EasingDirection.In)
			local tween = tweenService:Create(v, tweenInfo, {Position = landPosition})
			tween:Play()
			Last.Visible =true 
		end 
	end
	
end

Consider making the back tween same as forward one, except in the landPosition calculation replace - with +

1 Like