Is there a way to have a class inherit 2 base classes?
I am trying to do the following:
class NPC(FSM.FSM , DirectObject):
However I get the following error message:
TypeError: Error when calling the metaclass bases
module.init() takes at most 2 arguments (3 given)
Thank you
I have also tried adding init functions like the following, but have not got any further.
:
class NPC(FSM.FSM , DirectObject):
def __init__(self):
FSM.FSM.__init__(self,'Npc_FSM')
DirectObject.__init__( self )
Any idea what I am missing there? I get the same error. I’m stumped on this one.
I guess the DirectObject you imported is the module, not the class :
just import the class, not the module :
from direct.showbase.DirectObject import DirectObject
Thanks that worked.
I was using DirectObject to accept events