Ok, I’m about to kill someone. This is what’s happening:
I create a variable to store a reference to my GUI scene (conveniently named GUI), I proceed to loop through all the scenes looking for said GUI (printing every scene’s name) and then I attempt to store a reference to the GUI scene on my GUI variable, like this:
class PlayerCharacter(types.KX_GameObject): def __init__(self, own): # Get Current Scene self.current_scene = logic.getCurrentScene() # Get Game Controller self.game_controller = self.current_scene.objects['new_GameController'] #etc. etc. etc. self.gui = None # Get GUI for s in logic.getSceneList(): print(s) if s.name == 'GUI': self.gui = s else: self.gui = None
The problem is, sometimes self.gui has a reference to the GUI scene, sometimes it doesn’t. Any clue as to what might be happening?