Should I use GDScript or C# in the Godot game engine?

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
which language should you use when making your Guru game well if you don't know you have two main versions of Godot the standard one that comes with guru's GD script programming language it's a language made by the guru Developers for game development with Godot and the mono version which adds c-sharp support on top of that so you can code your game with gdscript or c-sharp or a mix of both now uh here I have a project coded both in GD script and c-sharp Link in the description and I have uh two scripts in either languages side by side first yes the c-sharp script is a bit longer but this is mostly a superficial difference due to the many brackets that you have to put in there so as far as I'm concerned I appreciate that gscript is a bit shorter but I don't think this is a very important difference the most important difference to me is the integration in the engine we generally recommend GD script because it's tightly integrated into Godot when coding in c-sharp you need an external development environment a visual studio Visual Studio code something like this but when using GD script you can click a script and directly get coding with autocompletion and everything the script editor in Godot is not the absolute best development environment but it's enough to be productive and it keeps you focused in the editor and you can see you get a linting you get error reporting as you type those kinds of things uh also a small Precision that gscript is a gradually typed language so if you like Dynamic languages uh you can just omit the types I tend to use them for better error reporting but it's up to you right so that might be also something that you might like about it but the most important parts are this ability to edit the scripts in Godot and then the speed at which you can run your code and iterate on the game if I press F5 right now to run the game you can see I get into it very very quickly because GD script is an interpreted language so there's not a compilation step that you might have with C sharp that's not too too long but still is going to cost you a couple of seconds every time you try a scene well with GD script you can go much faster another case in which gdscript can save you time is when heart reloading script changes so in the debug menu by default you have two check boxes synchronized scene and script changes that are turned on and here's what the second one does I have the code to make my character jump here I'm going to command it out and when I run the game if I press space the character does not jump as expected now if I uncomment the code and I go back to the game I can jump instantly so you could have the game running on one screen and make changes to the script on the other screen and there will be instantly reloaded in the game now with c-sharp this feature exists as well but every time you change one line of code you have to click a build button manually to rebuild the code before the change gets reflected in the game which will cost you a little bit of time one last thing that doesn't work amazingly well in c-sharp is the tool mode in Godot so at the top of my script in this project I have the tool keyword and this allows us to run code in the editor drawing code in this case so you can see that when I change the settings of my Collision shapes I have some drawing with different visual themes and we use this feature for tutorials for showing some selected shapes especially in the running game in running demos and this allows us to just show you interactable shapes that we want to highlight in a tutorial for example the thing is you can use this mode in c-sharp you can write this tool keyword but when you change the code same problem as with hot reloading during the game the changes will not propagate very well to the editor you might have to rebuild manually each time but you may also have to close and reopen the scene or the project for the changes to update well with GD script it will just update instantly this is why we recommend gdscript over c-sharp for most people basically unless you are a c-sharp developer on this channel you'll find quick answers to your questions about Godot and game development if you want higher quality videos and more curated content check out our Channel gdquest if you have any questions leave them in the comments below and with that I'll see you in the next one bye
Info
Channel: GDQuest Q&A
Views: 53,691
Rating: undefined out of 5
Keywords:
Id: zq7lsT-phx8
Channel Id: undefined
Length: 5min 9sec (309 seconds)
Published: Thu Nov 17 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.