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

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

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.

1 comment

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.

1 answer

knife:TweenPosition(UDim2.new(gui.Position.X.Scale, gui.Position.X.Offset,gui.Position.Y.Scale, gui.Position.X.Offset) , "Out" , "Quad" , .5 ,true)

1 comment

0

Is there a shorter way?

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