Getting my Panda to walk with key commands...

Ok, I’ve just started to code now in Panda… I’ve been trying to work this out from the manual and the reference, but not really getting very far right now… Sorry for the total noob of it all here…

So I have my enivornment (the default one from the Hello World) and the Panda, currently just standing there. I want the camera to rotate, which its doing, but I want the Panda to use its walk animation only when the user presses the keys (like W, A, S, D) on the keyboard… But how?? I’ve been trying, got the ESC key to exit the program (whoopy do, eh?) but how to get the walking animation going using the keyboard?

What I have so far…

#Imports
import sys
import math
import direct.directbase.DirectStart
from direct.task import Task
from direct.actor import Actor

#Load the first environment model
environ = loader.loadModel("models/environment")
environ.reparentTo(render)
environ.setScale(0.25,0.25,0.25)
environ.setPos(-8,42,0)

#Task to move the camera
def SpinCameraTask(task):
  angledegrees = task.time * 6.0
  angleradians = angledegrees * (math.pi / 180.0)
  base.camera.setPos(20*math.sin(angleradians),-20.0*math.cos(angleradians),3)
  base.camera.setHpr(angledegrees, 0, 0)
  return Task.cont

taskMgr.add(SpinCameraTask, "SpinCameraTask")

#Load the panda actor and its walk animation
pandaActor = Actor.Actor("models/panda-model",{"walk":"models/panda-walk4"})
pandaActor.setScale(0.005,0.005,0.005)
pandaActor.reparentTo(render)

#Events
base.accept('escape', sys.exit)

#Run the program
run()

have you looked at the roamingRalph example yet? it does exactly what you’r looking for.

Thank you… No I hadn’t looked at that… I really should think a little more before posting. Thank you!