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

How do I add the previous Vector2 to a new one?

Asked by
Validark 1580 Snack Break Moderation Voter
10 years ago

What I want: for i=1,420 do script.Parent.CanvasPosition=Vector2.new(i, 0) + [Previous Vector2] end

How do I add the previous Vector2?

Exactly what I am trying to do:

I have a scrollframe that is 1260 long horizontally and I want to use the above script to translate the CanvasPosition from (0, 0) to (420, 0) and then when I run the script again I want it to go from (420, 0) to (840, 0)

1 answer

Log in to vote
0
Answered by 10 years ago
for i=1,420 do 
    script.Parent.CanvasPosition= script.Parent.CanvasPosition + Vector2.new(1,0)
end
Ad

Answer this question