Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
adaspo -13
5 years ago
Edited 5 years ago

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

Log in to vote
0
Answered by 5 years ago

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!

Ad

Answer this question