Suppose I have a Frame's position is
UDim2.new(0,0,0)
and I want to tween the Frame's position X by 2, how do I do that? I tried the following but it returns an error.
frame:TweenPosition(UDim2.new(frame.Positon.X - 2, frame.Position.Y, frame.Position.Z)
Thanks:)
This is pretty easy to do when you get the hang of it.
All you need to do is define a frame, textbox, textlabel, etc. (basically any GUI object) and just put: TweenPosition() on the end of it with 4 properties.
Example:
local frame = script.Parent frame:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 1)
0.5, 0, 0.5, 0 will basically tween it to the middle of the screen. Assuming, its a frame and you didn't resize it. But you can put any position in there.
For more information, you can go here
I want to tween it base on it's original position, for an example, if it'x X is 0, I want it to tween to 0.5, if It's 0.3, I want it to tween to 0.8.