Sliding gui help

I’m a pretty new scripter and I was wondering; how to make a frame that would slide across the screen? I know how to make a fading one with tween service so I’ve been wondering if it’s possible to make a sliding one and how to do it.

Ok so after playing around a bit, I realized you have to use UDim2 giving me the following code. Don’t look at the extra variables that don’t get used, those were used for a code that was there before

local plr = game.Players.LocalPlayer
local plrgui = plr:WaitForChild("PlayerGui")
local character = plr.Character
local rs = game:GetService("ReplicatedStorage")
local gui = script.Fading:Clone()
local atable = rs.TableGui
local ts = game:GetService("TweenService")
local died = rs.DiedGUI

gui.Parent = plrgui
	print("Fired client")
	local Frame = gui:WaitForChild("Frame")

The important thing is to set the frame to a position you want it to slide from in the beginning!

If I want the frame to slide from the left into the middle, I need to set the Frame’s position to -1,0.
Because if I set the X axis to -1, that will mean the frame is outside the screen on the left, and 0 just means the Y axis is the same because I didn’t want it to curve from up or bottom.

If we want the Frame to return back, in my case, it would look like this:


We have to wait 1 or more than 1 second so the First tween plays completely before we start the new one.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.