Private/Public Properties
2025/12/27
- Type
- Learning Resource
- Format
- Glossary Article
- Version
- General
- Subject Tags
- Created
- Updated
- 2026/02/16
- 2025/12/27
In large organizations, is necessary. It allows different teams to work on different parts of the codebase without needing to know how the other parts work internally, as long as they know how to interact with them.
Each team is free to work on their parts of the code in any way they want, as long as all teams agree on how the external should look.
In some languages, this can be enforced at a language level, by marking properties as private or public. A private property is only accessible from within the script it is defined in, while a public property can be accessed from other scripts. Some languages also have protected properties, which are only accessible from subclasses.
In GDScript, there's no private or public keyword. Instead, GDScript uses a convention to mark properties as private or public. A property is considered private if its name starts with an underscore (_). This is called pseudo-private. It's a convention, not a language feature, so it's up to the programmer to respect it.
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…