Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can i make this gui go across the screen?

I was testing out a script i made, and i wanted to make a gui go across the screen. This script is not working for some reason. Can you please help me?

local background = script.Parent
for i = -1050, 0, 10 do
	background.Position.X.Offset = UDim2.new(i)
	wait()
end

1 answer

:TweenPosition, :TweenSize, and :TweenSizeAndPosition

Alrighty, let's get to it.

You're wanting to do something that already exists as a function for GuiObjects.. Tweening is fairly easy, if you know how CFrame.lerp() works. Tween is similar.

Also assuming you mixed up Scale,Offset.

Scale is first, Offset is second.

UDim2.new(Xscale, Xoffset, Yscale, Yoffset)

-- || Variables ||
local Background = script.Parent
Background:TweenPosition(UDim2.new(0,-1050,0,10), Enum.EasingDirection.In, Enum.EasingStyle.Quad, 1, false)

TweenPosition

Tweening-Stuffs

EasingStyle

EasingDirection

GuiObject

If you're really wanting to do it the way you've previewed to us, I guess I'll show that way too?

Comment that you want that way if you'd like, but for now. Best of luck!

1 comment

0

yes i would like the way i did it because im not completely familiar with tweening

This discussion is preserved as it was. New answers, comments, and votes are closed.