I have a central script which holds several properties for my character (the inventory) and several other scripts, which read these properties and do things due to them, but only out 50% of my scripts can “see” the central properties, all the rest return: error: module has no attribute named “name here”. Why does it do this, and why do only some of my scripts have the problem?
you will get that kind of error if you try to read a attribute that is not created yet. run a script that creates all the attributes first
The main script is hooked up to an always controller, and the others are all on pulse always, do that help? (If I put the inventory on pulse always, the inventory reverts to the defaults every tick).
try adding :
if hasattr(GameLogic, “Attribute name”):
on top of your scripts.
Or if you have a loading screen in a diferent scene , put the script that creates all attributes in the loading scene.