• How do you tell when an animation sequence has finished?
    2 replies, posted
  • Avatar of Bynari
  • I have an entity that uses a model (a mining drill) with three animations: there's the startup animation where the drill fires up and lowers into the ground, an active drilling animation which is looped, and a shutdown animation where the drill slows and is retracted. What I need to do is play the startup sequence, and then transition into the looped drilling animation. What is the best way to trigger the second animation as soon as the first one is complete?
  • Avatar of Al Capone
  • [CODE] local sched = ai_schedule.New() sched:AddTask("PlaySequence", {Name = "Sequence1"}) sched:AddTask("PlaySequence", {Name = "Sequence2"}) [/CODE] The PlaySequence task completes right after the animation finishes, see [URL="http://luabin.foszor.com/code/gamemodes/base/entities/entities/base_ai/tasks.lua"]Source[/URL]. EDIT: Since this is not a NPC I am not sure if my idea makes any sense.