ScaleTo

Constructor:

ScaleTo(scale)

Description

Scales all scalable objects under Model according to the given coefficient.

Parameters

Variable name Type Default Description
scale float Scale coefficient (uniform overall scale)

Examples

Create a model, a mesh part and a part. Respectively set the mesh part and the part as the children of the model, and perform split joint operation. Finally, scale all scalable objects under the Model according to the given coefficient.

wait(2) -- wait 2
local part1 = RWObject.Create("Part") -- create part1
part1.Position = Vector3.New(0,1,0) -- assign a vector to the part1 position
part1.Anchored = true -- part1 movability assignment
local part2 = RWObject.Create("Part") -- create part2
part2.Position = Vector3.New(0,2,0) -- assign a vector to the part2 position
part2.Anchored = true -- part2 movability assignment
local model = RWObject.Create("Model") -- create a model
part1.Parent = model -- set the parent of part1 as the model
part2.Parent = model -- set the parent of part2 as the model
wait(1) -- wait 1
model:MakeSplitJoint() -- perform split joint operation to all part objects under Model
model:ScaleTo(2) -- scale all scalable objects under Model