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

How do i randomize the y - axis?

Asked by 1 year ago

I have a imagelabel in a frame and im trying to tween the imagelabel to a random y axis but it does not work how its supposed to

local r = Random.new()


        clone.Parent = game.Players.LocalPlayer.PlayerGui.ScreenGui.spawnFrame

        clone.Position = UDim2.new(r:NextNumber(0,1), 0, 0.8, 0)

        clone:TweenPosition(UDim2.new(clone.Position.X, 0, r:NextNumber(0, 1), 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quint)

the x axis is random but the y axis is always the same

1 answer

Log in to vote
0
Answered by
ultrabug 306 Moderation Voter
1 year ago

I think the issue you have is that the UDim2 you make when tweening has too much data. For the scale of the position you are giving it both scale and offset. Instead you should give it clone.Position.X.Scale

Ad

Answer this question