Guide to the Godot game engine/Tips And Tricks

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Guide to the Godot game engine


<-- Making nodes Tips And Tricks

Skip to bottom

  1. When writing code, try to add comments wherever you can, as it makes it easier to understand. Trust me, my first game never used comments, and I gave up on it. At the same time, don't use too many comments. Only add them when necessary.
  2. Remember: "less is more". When creating code, don't try to think ahead and add hundreds of things you think you will need later. Stick to the few things you need now.
  3. When optimizing your code, try using the profiler, found on the "Debugger" dock, which is found next to "Output" and "Animation".
  4. It helps to have "separator" comments in very large scripts (more than 1000 lines) that have different sections. Example:
    # =====================
    # ===== Attacking =====
    # =====================
    

GDScript