Signals in Godot 4.3

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 พ.ย. 2024

ความคิดเห็น • 10

  • @alekseydanchin
    @alekseydanchin 4 หลายเดือนก่อน +1

    Thank you! I know this, but your samples are better than I've seen before.

  • @tetenc555
    @tetenc555 2 หลายเดือนก่อน

    hey, your videos are so great, i’m literally using them for college rn. keep up the good work! u explain so well

    • @cashewolddew
      @cashewolddew  2 หลายเดือนก่อน

      I'm super happy you told me about using this at college. I really hope to make more things that'll help you along the way. Keep up the great work! 🥜

  • @SuperTommieNL
    @SuperTommieNL 4 หลายเดือนก่อน

    Yes, you really got skills in teaching and explaining.

  • @Tom-hg9lw
    @Tom-hg9lw หลายเดือนก่อน

    what is the difference between your code and the godot documentation on 4:04?
    You: var projectile_szene: PackedScene = preload("res://......")
    Doc: var Bullet = preload("res://......")
    And why ist var "Bullet" written with upper case?
    Also the same question on 1:15? What is a type of a variable and when I need ti?

    • @cashewolddew
      @cashewolddew  หลายเดือนก่อน +1

      Regarding the choice between having "Bullet" with an upper case B, it's more a matter of preference, but generally, people go with naming variables only in lower case. It's generally better to go with the standard as it will help other devs understand your code better.
      Variable types are useful for many reasons. A few of them are:
      - better autocompletion in the editor
      - code could be faster, as Godot doesn't have to guess the type
      - it's generally safer if you have a type, as the compiler can warn you ahead of running the game that there is an issue

  • @calebpark7385
    @calebpark7385 3 หลายเดือนก่อน

    What's the reason for 4:37?

    • @cashewolddew
      @cashewolddew  3 หลายเดือนก่อน

      call_deferred delays the execution of the code until the idle time. This helps avoid issues that might appear when changing states of thinngs like collision shapes or physics stuff mid-frame.
      Here are some cases in which you might want to use call_deferred: docs.godotengine.org/en/stable/tutorials/performance/thread_safe_apis.html

    • @sargiskh
      @sargiskh 2 หลายเดือนก่อน

      @@cashewolddew besides add_child or removing child (queue_free) what else is unsafe?

    • @cashewolddew
      @cashewolddew  2 หลายเดือนก่อน +1

      @@sargiskh That's a great question! There are quite a few unsafe things. I actually made a video about call_deferred in which I talk about that: th-cam.com/video/rsXEGhuAFok/w-d-xo.html
      I'd like to know if it helped you! 🥜