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

Vector3 not working for "for" loop when increases in size?

Asked by 7 years ago

[Sorry for bad title had to be more specific] Okay so Im trying to make a part extend on every side here is the script

pt = game.Workspace.CHIP

for ok = 1,12 do
pt.Size = Vector3.new(1,1,1)+Vector3.new(1,1,1)
end

Okay so basically it's not extending how I want it I want it every 12 times to extend +1,1,1 But it just goes to Size 2,2,2 and it does it instantly ANy Idea why?

1 answer

Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

If you want the part to increase in size, you need to add the Vector3.new(1, 1, 1) to the part's existing size, like this:

pt = game.Workspace.CHIP

for ok = 1,12 do
    pt.Size = pt.Size + Vector3.new(1, 1, 1)
end

Additionally, if you want it to gradually increase in size, you can use wait(), like this:

pt = game.Workspace.CHIP

for ok = 1,12 do
    pt.Size = pt.Size + Vector3.new(1, 1, 1)
    wait(0.5)
end

Hopefully this helps.

0
Hey it did thanks !!! extremeyes 10 — 7y
Ad

Answer this question