Something wrong with my update function?

So I have a function to move my zombies (about 11 at first):

def update_zombie(self, task):
        for i in self.zombie:

            zdummy = self.zdummy[i.getPythonTag("ZDummy")]

            if i.getPythonTag("justHit") == False and i.getPythonTag("next2Protag") == False:
                i.setY(i, -.2)
            if i.getPythonTag("next2Protag") == True and i.getPythonTag("justHit") == False:
                i.setPythonTag("justHit", True)
                self.playerHP = ((self.playerHP)-10)
                i.setPythonTag("justHit", True)
                self.taskMgr.doMethodLater(.5, self.resetZombieHit, "reset zombie hit")
        return task.cont

I have it added to task manager. self.zombie is a list of zombies. I use zdummy to make sure zombies don’t look up or down. My zombies aren’t moving though. What’s wrong?

Hmm… Have you checked the “justHit” and “next2Protag” tags? Perhaps those aren’t being set properly?

Another thing that occurs to me is that you’re not accounting for the time between updates: you’re moving the zombies by -0.2 no matter how quickly the task is running. You might want to get the time between updates (I think that the global clock provides this - get the global clock object via “getGlobalClock()” and get the time between frames via “.getDt()”; see here and here for more) and multiply your movement speed by that; since said time between updates is likely to be very small, you may also want to increase the movement speed.