Moving Gui object onto Another Gui object using tweenservice

Basically i want to tween a Gui Object’s position in a way it moves ontop of another gui object

Heres some simple code that you can change to what you want (also its a local script inside of a screen gui)

local tweenService = game:GetService("TweenService")

local targetFrame = script.Parent:FindFirstChild("TargetFrame")
local movingFrame = script.Parent:FindFirstChild("MovingFrame")

local tweenInfo = TweenInfo.new(
	5, -- Duration of the tween
	Enum.EasingStyle.Cubic, -- Easing style
	Enum.EasingDirection.InOut, --Easing direction
	-1, -- How many times the tween repeats (-1 is infinite)
	true, -- If it reverts back to the original properties
	0 -- Delay between tweens
)

local tween = tweenService:Create(movingFrame, tweenInfo, {Position = targetFrame.Position})
tween:Play()
1 Like