crash with FSM._init__

  File "toontown/distributed/", line 336, in handleAvatarResponseMsg
    localAvatar = LocalToon.LocalToon(self)
  File "toontown/toon/", line 84, in __init__
    DistributedToon.DistributedToon.__init__(self, cr)
  File "toontown/toon/", line 83, in __init__
    DistributedPlayer.DistributedPlayer.__init__(self, cr)
  File "otp/avatar/", line 35, in __init__
    DistributedAvatar.DistributedAvatar.__init__(self, cr)
  File "otp/avatar/", line 26, in __init__
  File "otp/avatar/", line 49, in __init__
    self.nametag = NametagGroup()
  File "toontown/nametag/", line 55, in __init__
    self.nametag2d = Nametag2d()
  File "toontown/nametag/", line 26, in __init__
    Clickable2d.__init__(self, 'Nametag2d')
  File "toontown/toontowngui/", line 8, in __init__
    FSM.__init__(self, name)
  File "/Developer/Panda3D/direct/fsm/", line 158, in __init__
    self.state = 'Off'
TypeError: C++ object is not yet constructed, or already destructed.
   def __init__(self, name):
        FSM.__init__(self, name)
        PandaNode.__init__(self, name)

Your class inherits from PandaNode, but PandaNode already provides a property called ‘state’ that conflicts with the one in FSM.

To fix this, I suppose we could rename the ‘state’ variable to something else in But in this case you could also wonder whether inheriting from both PandaNode and FSM is the right thing to do, or whether instead you should use composition (ie. storing the node as a member of the class instead).