We need to make several changes to our code to make this work. We should be extra careful when following these directions to avoid making a mistake:
chp03_10.pyand resave it in the
DirectObjectso that we can inherit from it. Add the following line to your program below the very first line. This is case sensitive, so make sure to type it correctly.
from direct.showbase.DirectObject import DirectObject
Worldclass. Change the class definition line to the following: