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

How would i tween either X or Y without effecting the other?

Asked by
PastDays 108
6 years ago

For example this sets both the X and Y of the 'Ball'.

local Ball = script.Parent

while true do 
    wait(0.2)
    Ball:TweenPosition(UDim2.new(0,0,0.339,0),'Out','Linear',1)
end
0
it's always like that though? User#19524 175 — 6y
0
Ii dont know what you mean, I want to only set the X or Y of the 'Ball' so no matter where it is it goes down the screen or across the screen in a straight line. PastDays 108 — 6y

1 answer

Log in to vote
2
Answered by
jaschutte 324 Moderation Voter
6 years ago
Edited 6 years ago

This should keep the X static.

local Ball = script.Parent

while true do 
    wait(0.2)
    Ball:TweenPosition(UDim2.new(0,Ball.AbsolutePosition.X,0.339,0),'Out','Linear',1)
end

This should keep the Y static.

local Ball = script.Parent

while true do 
    wait(0.2)
    Ball:TweenPosition(UDim2.new(0,0.339,Ball.AbsolutePosition.Y,0),'Out','Linear',1)
end

I hope this is what you ment.

Ad

Answer this question