0 views0 copies0 likes
Slide-Out Menu with Reversible Animation
Universal script
Copy it, then test it in your own Studio place.
Script code
14 lines ยท 0.6 KBlocal TweenService = game:GetService("TweenService")local gui = script.Parentlocal panel = gui:WaitForChild("MenuPanel")local toggle = gui:WaitForChild("MenuToggle")local open = panel.Positionlocal closed = UDim2.new(-1, -panel.AbsoluteSize.X, open.Y.Scale, open.Y.Offset)local visible, tween = false, nilpanel.Position = closedtoggle.Activated:Connect(function() visible = not visible if tween then tween:Cancel() end tween = TweenService:Create(panel, TweenInfo.new(0.3, Enum.EasingStyle.Quart), {Position = visible and open or closed}) tween:Play()end)About this script
Inside a ScreenGui, create a Frame named MenuPanel and a TextButton named MenuToggle. Add this LocalScript alongside them. The button moves the panel between the position set in Studio and a point offscreen, canceling the old tween when clicked mid-animation. Keep the menu toggle outside the sliding panel and check narrow screen sizes before choosing the open position.
Log in to leave a comment.
No comments yet
Be the first to share your thoughts!
Comments
Share what works, ask questions, or report an issue.