Garry's Mod Wiki

Revision Difference

Entity:SetModelScale#514712

<function name="SetModelScale" parent="Entity" type="classfunc">⤶ <description>⤶ Scales the model of the entity, if the entity is a <page>Player</page> or an <page>NPC</page> the hitboxes will be scaled as well.⤶ ⤶ For some entities, calling <page>Entity:Activate</page> after this will scale the collision bounds and <page>PhysObj</page> 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 <page>Entity:EnableMatrix</page> instead.⤶ ⤶ If your old scales are wrong due to a recent update, use <page>Entity:SetLegacyTransform</page> as a quick fix.⤶ ⤶ <bug issue="2193">The hull does not scale properly with this function.</bug>⤶ ⤶ <bug issue="3502">This does not scale procedural bones and disables IK.</bug>⤶ </description>⤶ <realm>Shared</realm>⤶ <args>⤶ <arg name="scale" type="number">A float to scale the model by. 0 will not draw anything. &amp;amp;lt; 0 will draw the model inverted.</arg>⤶ <arg name="deltaTime" type="number" default="0">Transition time of the scale change, set to 0 to modify the scale right away.</arg>⤶ </args>⤶ </function>⤶ ⤶ <example>⤶ <description>From the "Biggify" option of right clicking an npc</description>⤶ <code>ent:SetModelScale( ent:GetModelScale() * 1.25, 1 )</code>⤶ ⤶ </example>