Skip to main content
Godot allows you to create custom node types that extend the engine’s functionality. With the @tool annotation and editor gizmos, you can provide a seamless editing experience for your custom nodes.

Creating Custom Node Types

Basic Custom Node

Create a custom node by extending an existing node type:
Register it as a custom type in an EditorPlugin:

Tool Scripts with @tool Annotation

The @tool annotation makes scripts run in the editor, enabling real-time visualization and editing:
Always use Engine.is_editor_hint() to separate editor-only code from runtime code. Tool scripts run in both editor and game.

Updating in the Editor

Use property setters to trigger updates when values change:

Adding Custom Editor Gizmos

Gizmos provide visual handles and overlays for editing 3D nodes. Create a gizmo plugin by extending EditorNode3DGizmoPlugin:

Register the Gizmo Plugin

Gizmo Materials

Create different material types for your gizmo:

Advanced Gizmo Features

Subgizmos

Allow selecting and editing sub-parts of your node:

Custom Property Editors

Create custom inspectors for your node’s properties:

Custom Property Editor Control

Example: Complete Custom Node

Here’s a complete example combining all concepts:
With corresponding gizmo:

Best Practices

Separate editor-only code from runtime code to prevent performance issues and unexpected behavior.
Call queue_redraw() in property setters to update the node’s appearance in the editor.
Always use EditorUndoRedoManager in gizmo commit methods to make changes undoable.
Remove custom types, gizmos, and inspector plugins in _exit_tree() to prevent memory leaks.
Return descriptive names from _get_gizmo_name() and _get_handle_name() for better UX.

See Also

Editor Plugins

Learn how to create editor plugins

Editor Interface

Access editor interface components