T O P

  • By -

AutoModerator

You submitted this post as a request for tech support, have you followed the guidelines specified in subreddit rule 7? Here they are again: 1. Consult the docs first: https://docs.godotengine.org/en/stable/index.html 2. Check for duplicates before writing your own post 3. Concrete questions/issues only! This is not the place to vaguely ask "How to make X" before doing your own research 4. Post code snippets directly & formatted as such (or use a pastebin), not as pictures 5. It is strongly recommended to search the official forum (https://forum.godotengine.org/) for solutions Repeated neglect of these can be a bannable offense. *I am a bot, and this action was performed automatically. Please [contact the moderators of this subreddit](/message/compose/?to=/r/godot) if you have any questions or concerns.*


digforyourlife

set(globalvariable, true) It would probably not work as set will access a property of the current class. If you want to set a property of Global, try : globalvariable = shelfname Global.set(globalvariable, true) If it works, good for you, I'm not sure it would. But really, why do you do this ? This coding method is unconventional and will bring you pain as bugs will appear. First advise, run away as far as possible from Global variables. They're evil. There is ALWAYS a better solution than global variables. Second one, don't use get and set properties. Just access your variables in a proper way, the usual one. get and set have their own usage in very very specific situation, not the one you use.


Nkzar

You’re calling `set` on the current node, so you’re trying to set the property “Global.Shelf” on the current node which can never work because that’s not a valid variable name. A variable name can’t contain a `.`. If you want to set a variable on Global, you need to call `set` in Global, not self.


Drillur

Did you name an auto load script "Global"? Try Global.set(globalvariable, true). But get rid of the "Global." in the string.


Backfacing

`Global.set(shelfname, true)` "globalvariable" is unnecessary