Garry's Mod Wiki

Revision Difference

render.Model#513066

<function name="Model" parent="render" type="libraryfunc">⤶ <description>⤶ Creates a new <page>Global.ClientsideModel</page>, renders it at the specified pos/ang, and removes it. Can also be given an existing <page>CSEnt</page> to reuse instead.⤶ ⤶ <note>This function is only meant to be used in a single render pass kind of scenario, if you need to render a model continuously, use a cached <page>Global.ClientsideModel</page> and provide it as a second argument.</note>⤶ ⤶ <bug issue="3307">Using this with a map model (<page>game.GetWorld</page>():[GetModel](/gmod/Entity/GetModel)()) crashes the game.</bug>⤶ </description>⤶ <realm>Client</realm>⤶ <file line="192-L216">lua/includes/extensions/client/render.lua</file>⤶ <args>⤶ <arg name="settings" type="table">Requires:&#xA;* &lt;page&gt;string&lt;/page&gt; model - The model to draw&#xA;* &lt;page&gt;Vector&lt;/page&gt; pos - The position to draw the model at&#xA;* &lt;page&gt;Angle&lt;/page&gt; angle - The angles to draw the model at</arg>⤶ <arg name="ent" type="CSEnt" default="nil">If provided, this entity will be reused instead of creating a new one with &lt;page&gt;Global.ClientsideModel&lt;/page&gt;. Note that the ent&#x27;s model, position and angles will be changed, and &lt;page&gt;Entity:SetNoDraw&lt;/page&gt; will be set to true.</arg>⤶ </args>⤶ </function>⤶ ⤶