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

How do you make a photo slide onto the screen smoothly, and not so immediately?

How do you make a photo slide onto the screen smoothly, and not so immediately?

I have now only that script in screen gui on LocalScript **I don't want to delete anything except Shop:TweenPosition(UDim2.new(0, 0,1, 0),"Out","Quad",0.5,false,End) ** and I don't even want to delete it, but tell me where to give it?

CODE IN LOCALSCRIPT IN SCREENGUI:

while wait() do
	wait(0.1)
	local mag = (workspace.Shops.Shop1.Position-game.Players.LocalPlayer.Character.HumanoidRootPart.Position).Magnitude
	if mag <= 6 then
		script.Parent.Shop.Visible = true
	else
		script.Parent.Shop.Visible = false
	end
end
Shop:TweenPosition(UDim2.new(0, 0,1, 0),"Out","Quad",0.5,false,End)

1 answer

Try using :TweenPosition or :TweenSize. They can move GuiObjects to certain points with smooth transitions. Try this example:

script.Parent.Shop:TweenPosition(UDim2.new(1,0,0,0),'Out','Linear',1)

If you test the game, you'll notice the GUI smoothly moves to 1,0,0,0.

How this works is this: The coodinates are the numbers inside of the UDim2 and the number at the end controls how fast the Tween will go. If I would replace that number with 5, then the GuiObject would take 5 seconds to Tween to 1,0,0,0.

I hope I helped!

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