Hey Guys! So basically I've created a model along with a custom animation for it.
What I found out was that I cannot seem to play the animation using entity:SetSequence() but if I create prop_dynamic, then the animation plays.
I'm using the code below to play "FLARE_BURN" on my entity: [code]
local seq = self:LookupSequence( "FLARE_BURN" )
self:ClearPoseParameters()
self:ResetSequenceInfo()
self:SetPlaybackRate( 1.0 )
self:ResetSequence( seq )
self:SetCycle( 0 )
self:SetSequence(seq)
[/code]
Don't use SetSequence, use ResetSequence.
Also post more of the code ( preferably all of it ).
Your SEN[b]T[/b] must be of anim type, and it must have the automatic frame advance thing.
Here's my "Animatable" SENT from the Easy Animation Tool:
[code]
AddCSLuaFile()
ENT.Base = "base_entity"
ENT.Type = "anim"
ENT.RenderGroup = RENDERGROUP_BOTH
ENT.AutomaticFrameAdvance = true
function ENT:Initialize()
self:SetSolid( SOLID_OBB )
end
function ENT:Think()
self:NextThink( CurTime() )
return true
end
if ( SERVER ) then return end
function ENT:Draw()
self:DrawModel()
end
function ENT:DrawTranslucent()
self:Draw()
end
[/code]
Notice the ENT:Think function, that is mandatory.
[QUOTE=Robotboy655;47949262]Don't use SetSequence, use ResetSequence.
Also post more of the code ( preferably all of it ).
Your SEN[b]T[/b] must be of anim type, and it must have the automatic frame advance thing.
Here's my "Animatable" SENT from the Easy Animation Tool:
[code]
AddCSLuaFile()
ENT.Base = "base_entity"
ENT.Type = "anim"
ENT.RenderGroup = RENDERGROUP_BOTH
ENT.AutomaticFrameAdvance = true
function ENT:Initialize()
self:SetSolid( SOLID_OBB )
end
function ENT:Think()
self:NextThink( CurTime() )
return true
end
if ( SERVER ) then return end
function ENT:Draw()
self:DrawModel()
end
function ENT:DrawTranslucent()
self:Draw()
end
[/code]
Notice the ENT:Think function, that is mandatory.[/QUOTE]
That worked! My entity type wasn't set to "anim".
Thanks Rubat.
Sorry, you need to Log In to post a reply to this thread.