Entity.SetSequence
From GMod Wiki
Function | |
Syntax | Entity:SetSequence( Integer sequence ) |
Description: | |
Sets the entity's model sequence. If the specified sequence is already active, the animation will not be restarted. | |
Returns: | nil |
In Object: | Entity |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Entity.SetSequence]Entity.SetSequence [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Example
Description | Set the entity to play the "idle" sequence. |
---|---|
Used on | |
Code | local sequence = self:LookupSequence("idle") self:SetSequence(sequence) |
Output | N/A |
Additional Notes
- You must add this line to a SENT to make it compatible with this function
ENT.AutomaticFrameAdvance = true
- Make sure you run the Think function every frame. Otherwise, animations will look choppy:
function ENT:Think() self:NextThink(CurTime()); return true; end