Pandai: Change animations when path completes

I am using pandai to move the player’s character when a click is registered. I would like to change the animation from ‘walk’ to ‘stand’ when the character arrives at the end position.

def pathTo(self, x, y, z):
  self.loop('walk')
  self.behavior.pathFollow(1)
  self.behavior.addToPath(x, y, z))
  self.behavior.startFollow()

Is there some function that I am missing that would allow me to hook into a completion event?

Hi!

Some times ago I have resolved this with a help of aiBehaviors.behaviorStatus(string AIName) method (see panda3d.org/manual/index.ph … _Behaviors )for checking state of used behaviours. On mouse click behaviour is started + a task for continuous check of status.

Maybe this will help if not too late :slight_smile: