Immediate-mode gizmos for all to use!
ImmediateGizmos is an immediate-mode gizmos drawing plugin/addon for Godot 4! ImmediateGizmos is designed to allow you to draw simple gizmos and text wherever and whenever in the code of your project, including in release builds!
ImmediateGizmos are used with through the ImmediateGizmos2D and ImmediateGizmos3D singletons.
These singletons feature methods for drawing line-based shapes as well as text.
By design, this addon has a similar interface as Unity's Gizmos but with more flexibility with where the draw calls occur and the ability to show in release builds.
For drawing lines, the line method can be used in both 2D and 3D.
This method has the arguments of the point from, the point to, as well as an optional color argument.
func lines() -> void:
ImmediateGizmos3D.line(Vector3.ZERO, Vector3.RIGHT, Color.RED);
ImmediateGizmos3D.line(Vector3.ZERO, Vector3.UP, Color.GREEN);
ImmediateGizmos3D.line(Vector3.ZERO, Vector3.FORWARD, Color.BLUE);All line-based methods include the optional color argument at the end of their calls, which can be left empty to default to Color.WHITE.
Contiguous line strips can be drawn with line_strip. This draws an array of points.
func strips() -> void:
var points : Array[Vector2] = [];
for i : int in 10:
points.append(Vector2(i, sin(time + i)))
ImmediateGizmos2D.line_strip(points);Color can also be set for all subsequence calls with the following:
# To set to red for example:
var color := Color.RED;
ImmediateGizmos2D.set_color(color);
# or
ImmediateGizmos3D.set_color(color);The addition of strips is also accompanied by the method line_strip, which draws a closed-loop line strip.
ImmediateGizmos2D.line_strip(points);For 2D you can draw arcs, circles, and capsule shapes:
func arcs_circles_capsules():
const radius := 0.4;
ImmediateGizmos2D.line_arc(Vector2.LEFT, Vector2.LEFT * radius, TAU * 0.5, Color.RED);
ImmediateGizmos2D.line_circle(Vector2.ZERO, radius, Color.GREEN);
ImmediateGizmos2D.line_capsule(Vector2.RIGHT, radius, 1.5, Color.BLUE);And similarly for 3D:
func arcs_circles_spheres_capsules():
const radius := 0.4;
ImmediateGizmos3D.line_arc(Vector3.LEFT * 1.5, Vector3.FORWARD, Vector3.LEFT * radius, TAU * 0.5, Color.RED);
ImmediateGizmos3D.line_circle(Vector3.LEFT * 0.5, Vector3.FORWARD, radius, Color.GREEN);
ImmediateGizmos3D.line_sphere(Vector3.RIGHT * 0.5, radius, Color.YELLOW);
ImmediateGizmos3D.line_capsule(Vector3.RIGHT * 1.5, radius, 1.5, Color.BLUE);For 2D you can draw rect and square shapes:
func rects_squares():
const radius := 0.8;
ImmediateGizmos2D.line_rect(Vector2.LEFT, Vector2(radius, radius * 2.0), Color.MAGENTA);
ImmediateGizmos2D.line_square(Vector2.RIGHT, radius, Color.GREEN);And similarly for 3D:
func cuboids_cubes():
const radius := 0.8;
ImmediateGizmos3D.line_cuboid(Vector3.LEFT, Vector3(radius, radius * 2.0, radius), Color.MAGENTA);
ImmediateGizmos3D.line_cube(Vector3.RIGHT, radius, Color.GREEN);Similar to color, a transform can be set that is used for all subsequent draw calls. This allows you to rotate and reposition draw calls as desired.
For 2D:
var transform := Transform2D(...);
ImmediateGizmos2D.set_transform(transform);And for 3D:
var transform := Transform3D(...);
ImmediateGizmos3D.set_transform(transform);This transform is applied onto the positions parsed into the draw function itself.
func transforms():
const radius := 0.4;
ImmediateGizmos3D.set_transform(Transform3D(Basis.from_euler(Vector3(50.0, 20.0, -40.0))));
ImmediateGizmos3D.line_sphere(Vector3.LEFT, radius, Color.RED);
ImmediateGizmos3D.set_transform(Transform3D(Basis.from_euler(Vector3(30.0, 20.0, 10.0))));
ImmediateGizmos3D.line_cube(Vector3.RIGHT, radius, Color.GREEN);
ImmediateGizmos3D.set_transform(Transform3D(Basis.from_euler(Vector3(10.0, 30.0, 30.0))));
ImmediateGizmos3D.line_capsule(Vector3.RIGHT * 1.5, radius, 1.5, Color.BLUE);You can also set the draw transform to a node's transform making all subsequent calls relative to that particular node, including translation, rotation, and scaling:
func transform_self():
ImmediateGizmos3D.set_transform(self.transform);
ImmediateGizmos3D.line_cube(Vector3.ZERO, 1.0, Color.CYAN);set_font set_font_size
Text drawing is possible with ImmediateGizmos and by default from the bottom left.
func text():
ImmediateGizmos2D.draw_text("Text!", Vector2.ZERO);
ImmediateGizmos3D.draw_text("Text!", Vector3.ZERO);The third and fourth arguments to the draw_text method are HorizontalAlignment and VerticalAlignment typed values respectively.
The font and font_size can be set like the following:
@export var font : Font = null;
@export var font_size : int = 60;
func text_font():
ImmediateGizmos2D.set_font(font);
ImmediateGizmos2D.set_font_size(font_size);
ImmediateGizmos2D.draw_text("Text!", Vector2.ZERO);ImmediateGizmos also works nicely with @tool scripts in the editor!
This includes a method for only drawing the target node when it's selected!
The following code will only draw the subsequent gizmos when the node, self, is being selected in the editor.
ImmediateGizmos2D.set_required_selection(self);
# or
ImmediateGizmos3D.set_required_selection(self);To guarantee consistent behavior between state changes, you can call the following function before any subsequent gizmo calls:
ImmediateGizmos.reset();These functions can be accessed either through ImmediateGizmos2D or ImmediateGizmos3D singletons.
| Method | Arguments | Description |
|---|---|---|
| set_color | color : Color |
Sets the default draw color of drawn gizmos. |
| set_transform | transform : Transform2D |
Sets the default transform of drawn gizmos. |
| set_required_selection | node : Node |
Sets the node that must be selected in the Editor for subsequent gizmo calls to show. |
| set_font | font : Font |
Sets the default font of draw text. |
| set_font_size | fontSize : int |
Sets the default font size of draw text. |
| reset | Resets all set states back to default. It's recommend to call this before any gizmo calls. |
These functions can be accessed through the ImmediateGizmos2D singleton.
| Method | Arguments | Description |
|---|---|---|
| line | from : Vector2to : Vector2color? : Color |
Draws a line from point from to point to. |
| line_strip | points : Array[Vector2]color? : Color |
Draws a continuous line from array points. |
| line_polygon | points : Array[Vector2]color? : Color |
Draws a continuous closed line loop from the array points. |
| line_arc | center : Vector2startPoint : Vector2radians : floatcolor? : Color |
Draws a continuous line from startPoint rotated by radians. |
| line_circle | center : Vector2radius : floatcolor? : Color |
Draws a circle of radius around center. |
| line_capsule | center : Vector2radius : floatheight : floatcolor? : Color |
Draws an axis-aligned capsule of radius and height around center. |
| line_rect | center : Vector2size : Vector2color? : Color |
Draws an axis-aligned rectangle of radius size around center. |
| line_square | center : Vector2size : floatcolor? : Color |
Draws an axis-aligned square of radius size around center. |
| draw_text | text : Stringposition : Vector2hAlign? : HorizontalAlignmentvAlign? : VerticalAlignmentscale? : float |
Draws test at position with world height of height and aligned based on hAlign and vAlign. |
These functions can be accessed through the ImmediateGizmos3D singleton.
| Method | Arguments | Description |
|---|---|---|
| line | from : Vector3to : Vector3color : Color |
Draws a line from point from to point to. |
| line_strip | points : Array[Vector3]color : Color |
Draws a continuous line from array points. |
| line_polygon | points : Array[Vector3]color : Color |
Draws a continuous closed line loop from the array points. |
| line_arc | center : Vector3axis : Vector3startPoint : Vector3radians : floatcolor : Color |
Draws a continuous line from startPoint rotated around the chosen axis by radians. |
| line_circle | center : Vector3axis : Vector3radius : floatcolor : Color |
Draws a circle of radius around center based on axis. |
| line_sphere | center : Vector3radius : floatcolor : Color |
Draws an axis-aligned sphere of radius around center. |
| line_capsule | center : Vector3radius : floatheight : floatcolor : Color |
Draws an axis-aligned capsule of radius and height around center . |
| line_cuboid | center : Vector3radius : Vector3color : Color |
Draws an axis-aligned cuboid of radius size around center. |
| line_cube | center : Vector3radius : floatcolor : Color |
Draws an axis-aligned cube of radius size around center. |
| draw_text | text : Stringposition : Vector3hAlign : HorizontalAlignmentvAlign : VerticalAlignmentheight : float |
Draws test at position with world height of height and aligned based on hAlign and vAlign. |
color?defaults toColor.white.hAlign?defaults toHORIZONTAL_ALIGNMENT_LEFT.vAlign?defaults toVERTICAL_ALIGNMENT_BOTTOM.height?defaults to0.25in world units.
Immediate Gizmos © 2026 by Jawdan.dev is licensed under CC BY 4.0
















