Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to check if a part has reached a certian size?

function MakeBigger()
	repeat wait(0.1)
		B1.Size = B1.Size + Vector3.new(.1,.1,.1)
	until B1.Size.Vector3 >= B1.Size.Vector3(1,1,1)
end

1 answer

On line four, you should note that a part's size property doesn't have a vector3, although it itself is a vector3. But, what you are doing is seeing if B1's size is bigger than B1's size Vector3 1,1,1 -which doesn't make sense.

What you should instead be doing is checking if all the components of B1's size are bigger than their corresponding goal component. Like so:

-- any line before the function
local goal = Vector3.new(1,1,1)
-- line 4
until B1.Size.X >= goal.X and B1.Size.Y >= goal.Y and B1.Size.Z >= goal.Z

This discussion is preserved as it was. New answers, comments, and votes are closed.