GetModelSize (Method): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>ArceusInator
New page: {{Method |name=GetModelSize |returns=Vector3 ''modelSize'' |description=Returns the Vector3 Size of the Model. |object=Model}}Category:Methods
 
m Text replacement - "</SyntaxHighlight>" to "</syntaxhighlight>"
 
(14 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Method
<onlyinclude>{{Method
|name=GetModelSize
|name=GetModelSize
|returns=[[Vector3]] ''modelSize''
|returns=[[Vector3]] ''modelSize''
|description=Returns the [[Vector3]] [[Size]] of the [[Model]].
|description=Returns the [[Vector3]] [[Size]] of the [[Model]].
|object=Model}}[[Category:Methods]]
|object=Model}}</onlyinclude>
 
{{clear floats}}
 
{{Example|
This code would create a model, put some parts in it, position them randomly, and then print its size:
<syntaxhighlight lang="lua">
local model = Instance.new('Model', Workspace) -- Create a model.
for i = 1, 5 do
-- Fill the model with randomly positioned parts.
local part = Instance.new('Part', model)
part.Anchored = true
part.Size = Vector3.new(math.random(5), math.random(5), math.random(5))
end
print(model:GetModelSize())
</syntaxhighlight>
 
The size my vary depending on the size of the parts.
}}
 
[[Category:Methods]]

Latest revision as of 06:09, 27 April 2023

GetModelSize( )
Returns Vector3 modelSize
Description: Returns the Vector3 Size of the Model.
Member of: Model


Example

This code would create a model, put some parts in it, position them randomly, and then print its size:

local model = Instance.new('Model', Workspace) -- Create a model.
 
for i = 1, 5 do
	-- Fill the model with randomly positioned parts.
	local part = Instance.new('Part', model)
	part.Anchored = true
	part.Size = Vector3.new(math.random(5), math.random(5), math.random(5))
end
 
print(model:GetModelSize())

The size my vary depending on the size of the parts.