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

How do you size models to a spesific vector3 value?

So I have learned frame and the uses are mainly to change position or orientation. But what I don't know is how to change the different sizes of a model via scripting.

I tried this script I found written by someone else

local scaleFactor = 1.01
local scaleFactor2 = 0.01
while scaleFactor2 < 1 do
	print(scaleFactor2)
	wait(0)
	for i , part in pairs(model:GetDescendants()) do
	     if part:IsA("BasePart") then
	          local partPos = part.Position
	          local offset = partPos - dilationCentre
	          offset = offset * scaleFactor
	          part.Position = dilationCentre + offset
	          part.Size = part.Size * scaleFactor
	     end
	end
	scaleFactor2 = scaleFactor2 + 0.01
end

It worked but it was hard to accurately change the size to a special vector3 size. Is there a way I can change a model to a vector3 value via script?

1 comment

0

I am pretty sure there is a way if this is what you're talking about. Here is a post that talks about it: https://devforum.roblox.com/t/is-this-the-best-way-to-scale-a-model/166021

1 answer

There is no way. Models do not have a size, it just keeps multiple objects in one place. You will have to resize the individual parts inside the model.

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