Revision Difference
Global.ClientsideRagdoll#514853
<function name="ClientsideRagdoll" parent="Global" type="libraryfunc">⤶
<description>⤶
Creates a fully clientside ragdoll.⤶
⤶
<note>The ragdoll initially starts as hidden and with shadows disabled, see the example for how to enable it.⤶
⤶
There's no need to call <page>Entity:Spawn</page> on this entity.⤶
⤶
The physics won't initialize at all if the model hasn't been precached serverside first.</note>⤶
⤶
<bug issue="1387">Clientside entities are not garbage-collected, thus you must store a reference to the object and call <page>CSEnt:Remove</page> manually.</bug>⤶
</description>⤶
<realm>Client</realm>⤶
<args>⤶
<arg name="model" type="string">The file path to the model.

<warning>Model must be precached with <page>util.PrecacheModel</page> on the server before usage.</warning></arg>⤶
<arg name="renderGroup" type="number" default="RENDERGROUP_OPAQUE">The <page>RENDERGROUP</page> to assign.</arg>⤶
</args>⤶
<rets>⤶
<ret name="" type="CSEnt">The newly created client-side ragdoll. ( C_ClientRagdoll )</ret>⤶
</rets>⤶
</function>⤶
⤶
<example>⤶
<description>Creates a new ragdoll with the player model of breen and enables rendering and shadows.</description>⤶
<code>⤶
local ragdoll = ClientsideRagdoll( "models/player/breen.mdl" )⤶
ragdoll:SetNoDraw( false )⤶
ragdoll:DrawShadow( true )⤶
</code>⤶
⤶
</example>