Garry's Mod Wiki

Revision Difference

Entity:SendViewModelMatchingSequence#514771

<function name="SendViewModelMatchingSequence" parent="Entity" type="classfunc">⤶ <description>⤶ Sends sequence animation to the view model. It is recommended to use this for view model animations, instead of <page>Entity:ResetSequence</page>.⤶ ⤶ This function is only usable on view models.⤶ ⤶ <bug issue="3229">Sequences 0-6 will not be looped regardless if they're marked as a looped animation or not.</bug>⤶ </description>⤶ <realm>Shared</realm>⤶ <args>⤶ <arg name="seq" type="number">The sequence ID returned by &lt;page&gt;Entity:LookupSequence&lt;/page&gt; or &lt;page&gt;Entity:SelectWeightedSequence&lt;/page&gt;.</arg>⤶ </args>⤶ </function>⤶ ⤶ <example>⤶ <description>Converting an ACT_VM_* enumeration to a sequence usable by the function.</description>⤶ <code>⤶ local VModel = self.Owner:GetViewModel( )⤶ local EnumToSeq = VModel:SelectWeightedSequence( ACT_VM_PRIMARYATTACK )⤶ ⤶ VModel:SendViewModelMatchingSequence( EnumToSeq )⤶ </code>⤶ <output>Sends the primary attack enumeration sequence to the view model and plays it.</output>⤶ ⤶ </example>