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?
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
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 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! 🥜
Thank you! I know this, but your samples are better than I've seen before.
hey, your videos are so great, i’m literally using them for college rn. keep up the good work! u explain so well
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! 🥜
Yes, you really got skills in teaching and explaining.
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?
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
What's the reason for 4:37?
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
@@cashewolddew besides add_child or removing child (queue_free) what else is unsafe?
@@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! 🥜