Enable GDScript Type Hints for Better Code | Godot 4 Quick Tip

Поделиться
HTML-код
  • Опубликовано: 28 дек 2024

Комментарии • 20

  • @jrmillerfilms
    @jrmillerfilms Год назад +6

    Coming from being a C# developer. I enjoy this way of coding. Helps reading through older code.

  • @htspencer9084
    @htspencer9084 11 месяцев назад +2

    Yeah, static typing supremacy!

  • @Entikai
    @Entikai Год назад +11

    They are currently working on adding optional errors if you don't statically type your GDScript.

  • @Paddyhudson
    @Paddyhudson Год назад +6

    Awe man, I was wondering why some things auto-suggested and some were just mysteries that I was expected to know from memorizing the docs. This should help a ton.

    • @brettmakesgames
      @brettmakesgames  Год назад

      Yeah, right? It's kind of incredible how much the static type hints help with auto-complete! A must-have in my opinion.

    • @nubsdre
      @nubsdre 11 месяцев назад

      To avoid that, I use vscode, much better

  • @bonsaipropaganda
    @bonsaipropaganda Год назад +2

    this is super helpful!

  • @owdoogames
    @owdoogames Год назад +5

    I think using static typing might also slightly improve performance - well, that's what other people have said, anyway. I've not used static typing up to now but will do so going forward with Godot 4.0.

    • @brettmakesgames
      @brettmakesgames  Год назад +2

      neat, had no idea! never considered that might be the case

  • @VHenrik007
    @VHenrik007 3 месяца назад

    Thanks, this was useful!

  • @njdarda
    @njdarda Год назад +9

    i wish there was a strict mode, which would enforce types. i guess you can always use c# instead.

    • @htspencer9084
      @htspencer9084 11 месяцев назад

      As a c# coder, I am actually really enjoying gdscript but do statically type pretty much everything.
      Things feel a lot more intuitive and organic with gdscript over c# for me

    • @Tarnest
      @Tarnest 9 месяцев назад +1

      It exists! At least in the current version of Godot 4.
      Turn on Advanced Settings
      Project Settings -> Debug -> GDScript
      - Untyped Declaration: Error
      - Unsafe Property Access: Error
      - Unsafe Method Access: Error
      - Unsafe Cast: Warn
      - Unsafe Call Argument: Error

  • @rangergreen1935
    @rangergreen1935 Год назад +1

    Can you enlighten me how to use autocomplete in Godot script? Like when I type most of the code i want to use one of the things it shows beneath my current line

  • @GenericInternetter
    @GenericInternetter 11 месяцев назад +1

    omfg ive been typing it manually this whole time lol

  • @ThatOnePandaHD
    @ThatOnePandaHD Год назад +1

    This is great

  • @ostroom
    @ostroom Год назад

    i just started to play with gadot, but i dont know how to programming... so i just watching everything lol to learn . Thx for your tips but im not advanced like that yet.

    • @brettmakesgames
      @brettmakesgames  Год назад +1

      Keep at it! Hope you're having fun with learning Godot and game development.