Garry's Mod Wiki

Revision Difference

WEAPON:PreDrawViewModel#565716

<function name="PreDrawViewModel" parent="WEAPON" type="hook"> <description>Allows you to modify viewmodel while the weapon in use before it is drawn. This hook only works if you haven't overridden <page>GM:PreDrawViewModel</page>.</description> <realm>Client</realm> <args> <arg name="vm" type="Entity">This is the view model entity before it is drawn.</arg> <arg name="weapon" type="Weapon">This is the weapon that is from the view model.</arg> <arg name="ply" type="Player">The the owner of the view model.</arg> <arg name="flags" type="number" added="2025.12.16">The <page text="STUDIO_">Enums/STUDIO</page> flags for this render operation.</arg>⤶ </args> <rets> <ret name="" type="boolean">Return `true` to prevent the default action of rendering the view model. `PostDrawViewModel` will NOT be called in this scenario.</ret> </rets> </function>