Frequently Asked GDScript Questions
What is GDScript used for?
GDScript is the internal scripting language used by the Godot Game Engine. It is used to program the basic logic that is used to control a game.
Godot games are built using Nodes such as Sprites and many other visual Nodes. Each Node may have an attached script that adds functionality to it such as to respond to the user input or time-based changes, react to collisions from other objects etc. GDScript is the simple language used to write these scripts.
Is GDScript faster than Python?
This question doesn’t make a lot of sense because you don’t choose to use GDScript over Python based on how fast a script performs, but rather which is best to use to solve your problem. Python is a general-purpose scripting language that is fast enough for many use cases, and GDScript is integrated with the Godot Game Engine to enable easy scripting of game code (so it is specialized).
Scripts in games are not focused on run speed, but coordinate the running of the internal features of a game engine that do run fast since these features are compiled and optimized as part of the Engine. Think about a script to control the throttle on a jet fighter plane. The script doesn’t need to run that fast.
Is GDScript the same as Python?
No, GDScript is way more simplistic than Python. It is similar in the way that the code is written though with indenting rather than using brackets to define scope. Otherwise it is a very different language.
Is it hard to learn GDScript?
No, it is easy to learn. It depends on your previous experience and aptitude to grasp the concepts of programming together with what resources that you use to learn it - this site etc.
For people with any prior knowledge of programming, you can learn the basics within a couple of hours.
The API however, which is all of the features (classes) of the engine will take much longer to master. But you will learn apspects of the API as and when you need the various features as you build your game.