Garry's Mod Wiki

Entity:SetModelScale

void Entity:SetModelScale( number scale, number deltaTime = 0 )

Description

Scales the model of the entity, if the entity is a Player or an NPC the hitboxes will be scaled as well.

For some entities, calling Entity:Activate after this will scale the collision bounds and PhysObj as well; be wary as there's no optimization being done internally and highly complex collision models might crash the server.

This is the same system used in TF2 for the Mann Vs Machine robots.

To resize the entity along any axis, use Entity:EnableMatrix instead.

If your old scales are wrong, use Entity:SetLegacyTransform as a quick fix.

The hull does not scale properly with this function.
This does not scale procedural bones and disables IK.

Arguments

1 number scale
A float to scale the model by. 0 will not draw anything. A number less than 0 will draw the model inverted.
2 number deltaTime = 0
Transition time of the scale change, set to 0 to modify the scale right away.

Example

From the "Biggify" option of right clicking an npc

ent:SetModelScale( ent:GetModelScale() * 1.25, 1 )

Page Links


Special Pages


Wikis

?

Render Time: 23ms

Session 0
DB GetPage 3
Generate Html 2
SaveChanges 10
Render Body 0
Render Sidebar 5