Classes & Inheritance
Extend built-in node classes and create custom reusable components with inheritance.
Scripting
No shortcutIntermediate6 min readQuick Reference
Classes & Inheritance
Godot EngineKeyboard Shortcut
N/A
Where to Find
Select any node → Click Attach Script button, or Script Editor panel
Best Used For
- ▸Write game logic with variables and functions
- ▸Connect nodes via signals for decoupled systems
- ▸Expose Inspector properties for designer tweaking
Intermediate⏱ 30–60 minutes to master
Key Settings
Extend:Override:Super:Custom scenes:
Inheritance lets you extend existing node classes. Every script in Godot implicitly extends Node or another node type.
Where to Find It
Scripts automatically inherit from the node they are attached to.
How to Use
- Extend:
extends CharacterBody2Dat the top of scripts. - Override: Redefine
_physics_process(delta)to customize. - Super: Call
super()to invoke parent methods. - Custom scenes: Save nodes as
.tscnfor reuse.
Pro Tips
- Use
class_nameto create globally accessible custom types. - Prefer composition over deep inheritance chains.
- Create reusable scene packs (.tscn + .gd files) as building blocks.