Entity/GetSequenceGroundSpeed

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

Contents

Description

Returns the ground speed of the entity's sequence.

Arguments

number sequenceId

The sequence ID.

Returns

number

The ground speed of this sequence.

Examples

Example

Move the NextBot based on the ground speed of its walking animation (within its coroutine).

NOTE

In most cases it's better to use NextBot:BodyMoveXY instead.

local sequence = self:LookupSequence( "walk_all" )

if ( sequence ) then
	self:StartActivity( ACT_WALK )
	self:SetSequence( sequence )
	self.loco:SetDesiredSpeed( self:GetSequenceGroundSpeed( sequence ) )
end


Personal tools
Navigation