Тёмный

Functions in Godot (Introduction) 

iaknihs
Подписаться 2,9 тыс.
Просмотров 4 тыс.
50% 1

Опубликовано:

 

25 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 30   
@mertgulec7541
@mertgulec7541 10 месяцев назад
Perfect tutorial. Very fast and answers everything I had in mind. Subbed!
@Zakronyx
@Zakronyx 2 года назад
Thanks dude I think I understand what functions are a little bit more now
@Harotyx
@Harotyx 2 года назад
Thanks, this video explained something None other tutorial did. Keep it up with Godot stuff. new sub 😘😘
@nightcode3171
@nightcode3171 3 года назад
Congrats for the 200 subs bro, keep it up. Also, this thing is very confusing sometimes so this is a nice tutorial to start with.
@iaknihs
@iaknihs 3 года назад
Thanks!
@diegomata1062
@diegomata1062 2 года назад
really great explanation , you just got a new subscriber
@karimhamdi3693
@karimhamdi3693 3 года назад
what a great tutorial! keep up the good dude.
@iaknihs
@iaknihs 3 года назад
Thanks a bunch!
@sigitsatriap6505
@sigitsatriap6505 3 года назад
nice explanation ,easy to understand , wait another video thanks !
@iaknihs
@iaknihs 3 года назад
Glad you liked it!
@RikThunder33
@RikThunder33 3 года назад
finally! Now I know the difference in functions.
@iaknihs
@iaknihs 3 года назад
I should suggest adding alignment to functions in Godot 4. I want chaotic neutral functions.
@RikThunder33
@RikThunder33 3 года назад
@@iaknihs what. xD
@IrvanQadri
@IrvanQadri 3 года назад
what keyboard shortcut you use in 4:20?
@iaknihs
@iaknihs 3 года назад
to put a number into a string, I just mark the number and then press the " key, (then I undo it with ctrl+z to show the into version)
@IrvanQadri
@IrvanQadri 3 года назад
@@iaknihs wow thanks! I thought it will replace the word with " like notepad lol
@ignaciodangelo6385
@ignaciodangelo6385 Год назад
Hello sir , good video . On the late part of the video , i do understand that you print(a) and it prints "1" because its the value returned by the function . But i dont understands why it prints 27 when you are not actually executing the function my_func at any stage of the function _ready (you only name it as a variable "a" )
@ViperV
@ViperV 3 года назад
does specifying return types or parameter types just for safe practice? or does it improve performance as well? i never specify in my functions and so far, everything runs ok. Should I start doing so in the future tho?
@iaknihs
@iaknihs 3 года назад
The warnings it gives can help you avoid mistakes while writing code, and that's about all it does. Makes sure you are passing/receiving the right type of values to prevent bugs. So no, absolutely not necessary to use, but depending on scale and complexity of your project it can help to avoid issues.
@ViperV
@ViperV 3 года назад
@@iaknihs Awesome! i'm kinda confident with not specifying types, so i think i'll stick with my lazy coding ways for now and I think runtime errors will still catch it anyway. Thanks a ton!
@abdiel3358
@abdiel3358 2 года назад
Nice! Thanks :) !
@AbdouMadjidi_.
@AbdouMadjidi_. 3 года назад
what "return" do in general?
@iaknihs
@iaknihs 3 года назад
Return ends a function, 'returning' to whichever code first called it. Return can optionally also take a value which can then be used in the code we return to.
@AbdouMadjidi_.
@AbdouMadjidi_. 3 года назад
@@iaknihs so return RERUNS the code above it and makes it able to modify?
@iaknihs
@iaknihs 3 года назад
@@AbdouMadjidi_. It continues the code that was already waiting for what's basically it's reply: say we have a function func add(a, b): return a+b and then we execute this code: # do something first add(3,7) # do something last then our "# do something last" line will only be executed after the add function we created returns it's value (in this case 10). The lower code basically waits for the function to finish doing whatever it does, and then continues when it 'returns'. if a function reaches it's end without the keyword "return" being written anywhere, it will automatically return without a value. so: func do_nothing(): pass is equivalent to func do_nothing(): pass return
@AbdouMadjidi_.
@AbdouMadjidi_. 3 года назад
@@iaknihs I didn't understand what the value wrote with "return" does
@iaknihs
@iaknihs 3 года назад
@@AbdouMadjidi_. it's given to wherever you return to. If you say: func add(a, b): return a+b var result = add(3, 7) print( result ) then you call function add with parameters 3 and 7, this function does whatever it does, and returns (gives back) the result of 10. you can then ignore the result, or like in this example put it into a variable, print it, or whatever else you want to do with it
@linuxrant
@linuxrant Год назад
little too fast, I can't understand relationships between properties inside those functions, and you just skip over and go onto next thing. You might as well just talk in chinese. I'm gonna go read some manual or find other video.
Далее
Физика пасты Карбонара 🧪🔬
00:57
Godot Dialogue System - Introduction / Tutorial
27:50
We made Vampire Survivors BUT in 10 Lines of Code
7:08
How to program in Godot - GDScript Tutorial
58:10
Просмотров 731 тыс.
Functions | Godot GDScript Tutorial | Ep 13
11:03
Просмотров 25 тыс.
How I Mastered GODOT In Only 5 DAYS!
7:03
Просмотров 187 тыс.
Learn programming with GDScript (Part 1)
1:14:26
Просмотров 45 тыс.
Functions vs Classes: When to Use Which and Why?
10:49
Просмотров 161 тыс.
I Made My First Game in Godot in 3 Weeks...
26:21
Просмотров 401 тыс.