Animation Problems

Hi, Maroon again. I’ve been making a character walk onto screen and turn towards the player and I’ve got all that done. Except for one detail. I can’t get him to stop playing the walk animation. Here’s the relevant part of my code.

move = LerpPosInterval(Cog,
                  (5),
                  (-10.36, 55.26, -4.05),
                  startPos=(-22.36, 55.26, -4.05),
                  other=None,
                  blendType='noBlend',
                  bakeInStart=1,
                  fluid=0,
                  name=None)
rotate = Cog.hprInterval(1.5, Vec3(-180, 0, 0))
move2 = Sequence(move, rotate)
move2.start()
	

I take it that “Cog” is the Actor that is animating? If not, replace “Cog” below with whatever Actor should be changed.

I think that you should be able to just insert a function interval into your sequence; if the Actor is intended to stop animating after the movement but before the rotation, then something like this might work:

move2 = Sequence(move, Func(Cog.stop), rotate)

Apparently func does not exsist.
WAIT WHAT? Func isn’t defined? wot is dis?
I’m probably doing something really wrong so this is what I’ve added on.

def Cogstop():
	Cog.loop("idle")

stopMove = Func(Cogstop)
move2 = Sequence(move, rotate, stopMove)

If you want the exact error name, it reads:

I think you need to import the direct interval stuff:

from direct.interval.IntervalGlobal import *

Or if you just need Func:

from direct.interval.IntervalGlobal import Func

Thanks! With a little tweaking, I’ve got this working perfectly.