Annotation
2025/12/27
- Type
- Learning Resource
- Format
- Glossary Article
- Version
- General
- Subject Tags
- Created
- Updated
- 2026/02/16
- 2025/12/27
An annotation is an extra piece of information or metadata included in code that provides the computer or the user with more information about how the code works.
In the GDScript language, annotations start with an @ sign and are used to change the behavior of the following code statement.
For example, the @onready annotation makes the initialization of a member variable run right before the _ready() function. And the @export annotation and its many variants make a property editable in the Inspector dock in the editor.
So, the following code:
@onready var label: Label = $LabelIs nearly equivalent to the following:
var label: Label = null
func _ready() -> void:
label = $LabelThe nuance is that the @onready annotation makes the initialization of the label variable run right before the _ready() function. In practice, it's the same as inserting the initialization code at the beginning of the _ready() function.
At the time of writing, Godot does not support creating custom annotations in the GDScript language. There's a proposal to add this feature, but the discussion is not settled yet.
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…