Is there anyway to tween a textlabel just on the x axis?

local pos = script.Parent.Position.Y
print(pos)

script.Parent:TweenPosition(
	UDim2.new(1.1, 0, script.Parent.Position.Y, 0),
	Enum.EasingDirection.Out,
	Enum.EasingStyle.Linear,
	3,
	false
)

I want to make the textlabel move from one side of the screen to the other, but I also want to randomize the y value. is there any way to do this?

Well, the title and the actual post say 2 different things, but I assume you want to use math.random()?

local pos = script.Parent.Position.Y
print(pos)

script.Parent:TweenPosition(
	UDim2.new(1.1, 0, math.random(0,100)/100, 0),
	Enum.EasingDirection.Out,
	Enum.EasingStyle.Linear,
	3,
	false
)

sorry, i was in a rush.

What I want to do is make it so the textlabel just goes across the screen on the x axis without changing the y axis. I want do that so that later I can make a math.random to assign the y value

script.Parent:TweenPosition(
	UDim2.new(
		1.1,
		script.Parent.Position.X.Offset,
		script.Parent.Position.Y.Scale,
		script.Parent.Position.Y.Offset
	),
	Enum.EasingDirection.Out,
	Enum.EasingStyle.Linear,
	3,
	false
)

This code should work, only changing the value of the X axis.

2 Likes