Entity/SendViewModelMatchingSequence

From Garry's Mod
Jump to: navigation, search
 Entity:SendViewModelMatchingSequence( )

Contents

Description

Sends sequence animation to the view model. It is recommended to use this for view model animations, instead of Entity:ResetSequence.

This function is only usable on view models.

BUG

Sequences 0-6 will not be looped regardless if they're marked as a looped animation or not.

Issue Tracker: #3229

Arguments

number seq

The sequence ID returned by Entity:LookupSequence or Entity:SelectWeightedSequence.

Examples

Example

Converting an ACT_VM_* enumeration to a sequence usable by the function.

local VModel = self.Owner:GetViewModel( )
local EnumToSeq = VModel:SelectWeightedSequence( ACT_VM_PRIMARYATTACK )

VModel:SendViewModelMatchingSequence( EnumToSeq )

Output:

Sends the primary attack enumeration sequence to the view model and plays it.
Personal tools
Navigation