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

How to tween a gui's position to another gui's position?

Asked by 7 years ago

Hey I was just wondering how I would be able to tween a Gui to another Gui's position because whenever I try to do that it doesn't work because if I put in the position it will show up as {num,num} {num,num} but the correct formatting is (num,num,num,num).

This is the code:

function knifeSlide(knife)
    knife:TweenPosition(UDim2.new(0.5, -100,0.5, -100) , "Out" , "Quad" , .5 ,true)
    knife:TweenPosition(UDim2.new(1, -100,1, -100) , "Out" , "Quad" , .5 ,true)
end

knifeSlide(script.Parent.KnifeImage)

Thanks.

0
This looks about fine to me. Worth noting, Tweening doesn't yield the script, so you should put wait(0.5) between the tweens. OldPalHappy 1477 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago
knife:TweenPosition(UDim2.new(gui.Position.X.Scale, gui.Position.X.Offset,gui.Position.Y.Scale, gui.Position.X.Offset) , "Out" , "Quad" , .5 ,true)
0
Is there a shorter way? Boogieboon 30 — 7y
Ad

Answer this question