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

Find Model size using script?

How do You find a model's size? I have no idea where to start on this one, I need it for a script that only let's You insert models under a certain size limit.

Also, is it possible to check the model's size without inserting it?

1 answer

✓ Accepted answer

So lets create a completely random model, just for an example:

local model = Instance.new('Model', Workspace)  --Makes our model

for i = 1, 20 do
	local part = Instance.new('Part', model)  --Creates a part
	part.Anchored = true
	part.Size = Vector3.new(math.random(1,50), math.random(1,50), math.random(1,50))  --Random size
	part.Position = Vector3.new(math.random(1,50), math.random(1,50), math.random(1,50))  --Random positions
end

We have no clue what the size of the model is, so you can try this at the end of that script:

print(model:GetModelSize())

Give it a shot, and let me know if I need to elaborate.

2 comments

0

You mean there's a GetModelSize Function? I'm laughing so much Right now, I didn't check to see if there was a pre-loaded function.

0

Lol, it's ok. People underestimate the methods of models all the time. I didn't even know TranslateBy() existed until I looked it up!

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