Prerequisites
Make sure you have already installed Vector Display 2D and enabled the plugin in your Godot project.
Creating Your First Vector Display
Create a scene with a moving object
First, you need an object with a Vector2 property to visualize. Let’s create a simple character that moves with velocity.Create a new scene with a
CharacterBody2D node and attach this script:player.gd
The
velocity property is a Vector2 that we’ll visualize with Vector Display 2D.Add a VectorDisplay2D node
With your CharacterBody2D selected in the scene tree, add a child node. Search for VectorDisplay2D in the node creation dialog.Your scene tree should look like this:
Configure the target
Select the VectorDisplay2D node and configure it in the Inspector:
- Target Node: Click the dropdown and select
..(parent) - this points to your CharacterBody2D - Target Property: Type
velocity- this is the Vector2 property we want to display
If you leave Target Node empty, it will automatically use the parent node.
Create a VectorDisplaySettings resource
In the Inspector for VectorDisplay2D, you’ll see a Settings property. Click the dropdown and select New VectorDisplaySettings.Click the resource to expand it and configure these basic settings:
- Show Vectors: ✓ (enabled)
- Show Axes: ✓ (enabled to see X and Y components)
- Vector Scale: 1.0 (adjust if vectors appear too large or small)
- Width: 3.0 (thicker line for better visibility)
- Main Color: Yellow (or your preferred color)
Test in-game
Press F5 to run your game. You should now see:
- A yellow arrow showing your velocity vector
- A red line showing the X component (horizontal velocity)
- A green line showing the Y component (vertical velocity)
- Press left/right arrow keys - watch the velocity vector change direction
- Press space to jump - see the Y component change
- Press Shift + V to toggle the vector display on/off
Understanding What You See
The visualization shows three elements:Main Vector
Yellow arrow - The complete velocity vector showing both direction and magnitude
X Component
Red line - Horizontal component of velocity (velocity.x)
Y Component
Green line - Vertical component of velocity (velocity.y)
Customize Your Display
Now that you have a basic vector displaying, try these customizations:Adjust vector scale
Adjust vector scale
If your vectors appear too small or too large, change the Vector Scale setting:
Use different length modes
Use different length modes
The Length Mode controls how vector length is displayed:
- Normal: Shows actual vector magnitude (default)
- Clamp: Limits maximum length while preserving direction
- Normalize: All vectors same length, only shows direction
Change pivot mode
Change pivot mode
The Pivot Mode controls where the vector originates:
- Normal: Vector starts from character position (origin)
- Centered: Vector is centered on character position
Enable rainbow mode
Enable rainbow mode
Rainbow mode colors the vector based on its angle, creating a beautiful spectrum effect:
Add dimming effect
Add dimming effect
Dimming makes shorter vectors fade to a fallback color:
Visualizing Multiple Vectors
You can add multiple VectorDisplay2D nodes to visualize different properties:player_with_multiple_vectors.gd
Runtime Toggling
The default Shift + V shortcut toggles all vector displays. This is perfect for:- Debugging during development
- Comparing different states
- Creating tutorial modes
- Performance profiling
Common Issues
Vectors not appearing
Vectors not appearing
Check these points:
- Target node is set correctly (or auto-assigned to parent)
- Target property name matches exactly (case-sensitive)
- The property is actually a Vector2 type
- The vector has a non-zero magnitude
- Settings → Show Vectors is enabled
Vectors are too small/large
Vectors are too small/large
Adjust the Vector Scale setting:Or use Length Mode → Normalize with a fixed max_length.
Can't find VectorDisplay2D node
Can't find VectorDisplay2D node
Make sure the plugin is enabled:
- Go to Project → Project Settings → Plugins
- Check that Vector Display 2D is enabled
- Restart Godot if necessary
Error: 'Target property is not a Vector2'
Error: 'Target property is not a Vector2'
The property you’re trying to visualize must be of type Vector2. Check:
Next Steps
Core Concepts
Understand how Vector Display 2D works under the hood
Customization Guide
Explore all customization options in detail
Examples
See real-world examples and use cases
API Reference
Complete API documentation for all classes
