About 4,230,000 results
Open links in new tab
  1. Access var from another script in Godot - Stack Overflow

    Jan 26, 2022 · Pe2node (Node2D) node has attached pe2.gd script and it has variable - shift. HUD node (CanvasLayer) has attached HUD.gd script and I want display variable shift from …

  2. How to create an object with gdscript? - Stack Overflow

    Mar 21, 2020 · 3 Mirza, Initially, your script will need to be attached to a parent node. I'm using a plain Node object. Change this to whatever type your parent node is. The code is commented, …

  3. Is there such thing as a global variable? (GDscript)

    Jan 23, 2023 · Old Answer Is there a way in GDscript that you can make a variable that works across all nodes with scripts. You could use an autoload. Go to the Project menu, the Project …

  4. gdscript - How to reference node in Godot - Stack Overflow

    Jul 8, 2022 · 2 Just to extend to the answer of Theraot: If your script is attached to your PlayerStateMachine Node you can access it via the node. So as an example, if you have a …

  5. How different is GDscript from Python? - Stack Overflow

    Jan 27, 2023 · I recently started developing games on Godot after 3 months of Python experience. Is it good to learn Python before jumping into GDscript? If not, how different are …

  6. (GDscript) Autoload doesn't seem to be working - Stack Overflow

    Aug 23, 2023 · This is really just a half answer, but I got the variables working when I assigned the script to the parent node in my main scene. This should allow my game to work, but it's not …

  7. How to create and set a new script to a node during runtime?

    Jun 25, 2023 · my sincerest of apologies I meant to write code.gd and you're right the export works when I store the code in string format (like_this) but for some reason when I try to read …

  8. Proper way to instanciate class in godot (preload vs class_name)

    Sep 19, 2022 · You can use class_name everywhere in your game code. The differences I'm aware of are: preload can take a relative path. class_name classes are always available. …

  9. GD Script. I'm trying to get enemy movement working

    Mar 6, 2025 · GD Script. I'm trying to get enemy movement working Asked 9 months ago Modified 9 months ago Viewed 81 times

  10. How to import class from one script into another? - Stack Overflow

    Sep 22, 2024 · The solution is that scriptA.gd must be added to project globals (it becomes like singleton) and have needed class in this script. Then in scriptB.gd just do var Effect = …