[SOLVED] Trying to call boolean value from one script in another

I’ve followed other forum examples to perform similar tasks in my code, but for some reason it seems to refuse to follow suit when I attempt to access a boolean variable. I get access to the script by making the entity it is attached to an attribute of the other script: Buttons.attributes.add(‘manager’, {type: ‘entity’});, then try to access the boolean: this.bet = this.manager.script.gameManager.removedCoins;, and use it later when I need it: if(this.bet === true), but no matter how I try the value always comes back undefined.

Here is link to full code.

In your GameManager script you do not define removedCoins as a property of the GameManager. Instead you are just defining a variable called removedCoins outside the scope of the GameManager. Try doing this.removedCoins = false inside the initialize method of the GameManager instead.

That fixed it, always the small things that cause the biggest problem.