task parameter

hi to all,

I have an issue with the task parameter.

I know that you can use task in this way:

#init function
taskMgr.add( self.updateCamera, 'updateCamera')

#run every frame
def updateCamera( self,  task):
    #do simple stuff

    self.last = task.time
    return Task.cont

now I want to use the task in this way:

#init function
taskMgr.add( self.updateCamera, 'updateCamera')

self.down = DirectButton(.... command=self.updateCamera, extraArgs= ["updateCameraGUI"] ...) 

#run every frame
def updateCamera( self,  task):
    if self.down.guiItem.isButtonDown():
           #do simple stuff

    self.last = task.time
    return Task.cont

How can I pass the task parameter in order to use the task.time?
If I don`t use the extraArgs parameter I got the error for a missing argument. If I use it I got the error that task is an str object.(which is true since I pass a string parameter).

Any ideas?
Thanks

Well, you can’t. You’ll need to remove the “task” parameter and use globalClock.getRealTime() instead.

thanks pro-rsoft. it works fine!