GM/CalcMainActivity

From Garry's Mod
Jump to: navigation, search
 GM:CalcMainActivity( )

Contents

Description

This hook is used to calculate animations for a player.

WARNING

This hook must return the same values at the same time on both, client and server. On client for players to see the animations, on server for hit detection to work properly.

BUG

This can return the incorrect velocity when on a moving object.

Issue Tracker: #3322

Arguments

Player ply

The player to apply the animation.

Arguments

Vector vel

The velocity of the player.

Returns

number

ACT_ Enums for the activity the player should use. A nil return will be treated as ACT_INVALID.

Returns

number

Sequence for the player to use. This takes precedence over the activity (the activity is still used for layering). Return -1 or nil to let the activity determine the sequence.
Personal tools
Navigation