This is part of my code, that I will explain for better understanding:
it’s supposed to play ‘shoot’ animation (by means of an actorInterval) and when it ends, enter the ‘Stand’ state in the finite state machine. Somehow, it seems to do the job, but I tried to improve the code so if the animation is playing, the code won’t run the sequence over. The problem is that getCurrentAnim ALWAYS RETURN NONE and isPlaying returns 0
Unless there is some error in the code, I feel this is one of those things where code should work as it is but actually does not.
def enterShoot(self,world):
if (world.eric.getCurrentAnim()!="shoot"):
print world.eric.getCurrentAnim()
myInt1 = world.eric.actorInterval("shoot",1)
print myInt1.isPlaying()
myInt2= Func( self.demand,"Stand",world)
mySec = Sequence(myInt1,myInt2,name="mySec")
mySec.start()
print world.eric.getCurrentAnim()
print myInt1.isPlaying()
As You could expect, If using regular play, it does work
world.eric.play("sit")
print world.eric.getCurrentAnim()
Someone can help about this?
Thanks