Type
2025/12/27
- Type
- Learning Resource
- Format
- Glossary Article
- Version
- General
- Subject Tags
- Created
- Updated
- 2026/02/16
- 2025/12/27
In computer programming, a type, also called data type, is a set of rules that groups values together. It describes which values are part of the same group and what operations are available for them.
Concretely, in Godot, vectors, nodes, numbers, strings, and more are types: int, float, String, Vector2, Sprite2D, Timer...
When we say that a variable is of a certain type, we mean that it can only hold values that are part of that type. For example, a variable of type int can only store integer values (whole numbers).
Often, when we use keywords like Vector2 in GDScript, we are referring to data types. For example, when we write a type hint to indicate the type of a variable or of a value returned by a function: var offset: Vector2.
However, Vector2 is also a class. In short, a class is a concrete implementation of the Vector2 type. When you construct a new Vector2 value, you are creating an instance of the Vector2 class. For example, the code Vector2(100, 200) creates a new instance of the Vector2 class with the x and y values set to 100 and 200, respectively.
This means that Vector2 is a type, but it is also a class:
is or as keywords in GDScript, we are referring to the type. It is a description of the value's interface: what data it has and what operations are available on the data.The close relationship between types and classes can be confusing. In practice, developers often use the two terms interchangeably.
Don't stop here. Step-by-step tutorials are fun but they only take you so far.
Try one of our proven study programs to become an independent Gamedev truly capable of realizing the games you’ve always wanted to make.
Get help from peers and pros on GDQuest's Discord server!
20,000 membersJoin ServerThere are multiple ways you can join our effort to create free and open source gamedev resources that are accessible to everyone!
Sponsor this library by learning gamedev with us onGDSchool
Learn MoreImprove and build on assets or suggest edits onGithub
Contributeshare this page and talk about GDQUest onRedditYoutubeTwitter…