Garry's Mod Wiki

GM:CalcMainActivity

number, number GM:CalcMainActivity( Player ply, Vector vel )

Description

This hook is used to calculate animations for a player.

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.
This can return the incorrect velocity when on a moving object.

Issue Tracker: 3322

Arguments

1 Player ply
The player to apply the animation.
2 Vector vel
The velocity of the player.

Returns

1 number
Enums/ACT for the activity the player should use. A nil return will be treated as ACT_INVALID.
2 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.

Page Links


Special Pages


Wikis

?

Render Time: 40ms

DB GetPage 7
Generate Html 10
SaveChanges (1) 14
Render Body 0
Render Sidebar 6