Walk Cycle Help

So I have a walk cycle and it walks 20 units forward per cycle and snaps back to 0 and repeats. Is there a way to make the animation loop but after each cycle move the actor 20 units forward?
Heres the code I am using

#Importing Modules 
import direct.directbase.DirectStart 
from direct.task import Task 
from direct.showbase import DirectObject 
from pandac.PandaModules import KeyboardButton 
from direct.actor import Actor 
import math 

#Load Robo 
Robo = Actor.Actor("/c/Panda 3d Models/RoboVentures/Models/Robo.egg", {"walk":"/c/Panda 3d Models/RoboVentures/Models/RoboWalk.egg"}) 

class ReadKeys(DirectObject.DirectObject): 
    def __init__(self): 
        self.accept('arrow_up', self.RoboWalk) 
        self.accept('arrow_up-up', self.RoboStop)

    def RoboWalk(self):
    def RoboStop(self):


Thank you

It’s usually easier to build the walk cycle without the forward motion; just let him walk in place. Then apply the forward motion in the Python code, for instance with a lerpInterval.


So if i wanted to press the up arrow and loop the animation and when the up arrow is let go of it stops the animation, what code would I use for the intervals? Would it be similar to accept(<arrow_up-up>, )?

Making an avatar walk in general is kind of complicated. Have you seen the Roaming Ralph sample? Or any number of similar samples posted by people in the forum.