Reminder: from direct.task import Task
OK. This and the next tutorial cover useful methods for animating your actors and scenes in Panda3D
If you want a function to be called at every frame, you add a task to the task manager.
taskMgr.add(Function, "FunctionName")
Where a task is a function defined as follows:
def Function(task): #do something... return Task.cont # use Task.done to stop the task
From the task argument task.time returns the time (in milliseconds I guess)
1 Response to “Panda3D: Run a Function at Every Frame”