GravityWalker import issue

I’m trying to import GravityWalker into my Toon class, but I keep getting an error code.

Traceback (most recent call last):
  File "C:/Users/goodisam000/Desktop/Panda3D/", line 5, in <module>
    from Messenger import Messenger
  File "C:\Users\goodisam000\Desktop\Panda3D\", line 3, in <module>
    from MakeAToon import MakeAToon
  File "C:\Users\goodisam000\Desktop\Panda3D\", line 5, in <module>
    from Toon import Toon
  File "C:\Users\goodisam000\Desktop\Panda3D\", line 5, in <module>
    from direct.controls.GravityWalker import GravityWalker
  File "C:\Panda3D-1.9.2\direct\controls\", line 25, in <module>
    class GravityWalker(DirectObject.DirectObject):
  File "C:\Panda3D-1.9.2\direct\controls\", line 27, in GravityWalker
    wantDebugIndicator = base.config.GetBool('want-avatar-physics-indicator', 0)
NameError: name 'base' is not defined

Here’s my code for importing:

from import Actor
import random
from pandac.PandaModules import *
#import Globals
from direct.controls.GravityWalker import GravityWalker

I have a Showbase initialized, and it runs properly as should. I’ve had this issue for a while and can’t for the life of me figure out a fix.

Hello xsammyboi,

this error should be fixed in the development version of Panda3D (1.10). If you’d like to use the gravity walker class in version 1.9 you have to move the import after you initialized showbase, as it needs “base” which first gets defined after showbase was initialized.