There is a race condition before the variables are made where the update function runs before the rest of the code is initialized.
First, yes, here is proof of the crash.
Second, CustomFPC is not the reason, this is the code for CustomFPC, it calls super().__init__() which runs FirstPersonController's __init__ function and the rest is handled by FirstPersonController.
class customFPC(FirstPersonController):
def __init__(self, **kwargs):
super().__init__(**kwargs)
def input(self, key):
super().input(key)
playerID = decodedGameToken[0]
if playerID in gameState['PLAYERS'] and key == 'left mouse down':
server.send(server.connections[0], b'FIRE\x00' + serverToken.encode('ascii'))
Last, if setting the self.enabled to False also works, its better to do that, I just couldn't replicate this race condition to test that.
There is a race condition before the variables are made where the update function runs before the rest of the code is initialized. First, yes, here is proof of the crash.
Second, CustomFPC is not the reason, this is the code for CustomFPC, it calls super().__init__() which runs FirstPersonController's __init__ function and the rest is handled by FirstPersonController.
Last, if setting the self.enabled to False also works, its better to do that, I just couldn't replicate this race condition to test that.