Entity/FrameAdvance

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
(Added missing argument)
 
Line 5: Line 5:
 
|Realm=Shared
 
|Realm=Shared
 
|IsClass=Yes
 
|IsClass=Yes
 +
}}
 +
{{Arg
 +
|type=number
 +
|name=interval
 +
|desc=How many seconds to advance the cycle. Set to 0 to let the engine calculate this for you based on {{GlobalFunction|CurTime}}.
 
}}
 
}}
 
{{Example
 
{{Example

Latest revision as of 17:48, 6 September 2019

 Entity:FrameAdvance( )

Contents

Description

Advances the cycle of an animated entity.

Animations that loop will automatically reset the cycle so you don't have to - ones that do not will stop animating once you reach the end of their sequence.

Arguments

number interval

How many seconds to advance the cycle. Set to 0 to let the engine calculate this for you based on CurTime.

Examples

Example

From DModelPanel

function PANEL:RunAnimation()
	self.Entity:FrameAdvance( (RealTime()-self.LastPaint) * self.m_fAnimSpeed )	
end

Output:

Animates the entity
Personal tools
Navigation