Prerequisites
Before you begin, ensure you have:- Godot 4.0 or later installed
- Vector Display 2D addon enabled in your project
- A scene with a node that has a Vector2 property (e.g., a CharacterBody2D with velocity)
Step-by-Step Setup
Create the VectorDisplay2D node
In your scene tree, add a new
VectorDisplay2D node as a child of the node whose vector you want to display.For example, if you want to display the velocity of a player character:- Right-click on your
Player(CharacterBody2D) node - Select Add Child Node
- Search for
VectorDisplay2Dand add it
Configure the target node
With the VectorDisplay2D node selected, configure the Target Node in the Inspector:If you leave
target_node empty, it will automatically use the parent node.The target node is the node that contains the Vector2 property you want to visualize.
Set the target property
Specify which Vector2 property to display in the Target Property field:Common Vector2 properties to visualize:
velocity- Movement speed and directionlinear_velocity- Physics velocity for RigidBody2Ddirection- Custom directional vectors- Any custom Vector2 variable in your script
Create a settings resource
Create a new
VectorDisplaySettings resource to customize how your vectors are displayed:- In the Inspector, click the dropdown next to Settings
- Select New VectorDisplaySettings
- Click on the resource to edit its properties
- Yellow colored main vector
- Red X-axis, Green Y-axis
- Scale of 1.0
- Width of 2 pixels
- Arrowhead enabled
Quick Start Example
Here’s a complete minimal setup:Next Steps
Now that you have a basic setup working:- Learn about customization options to change colors, scale, and rendering modes
- Explore runtime configuration to modify vectors during gameplay
- Check out keyboard shortcuts to customize the toggle key
- Create reusable presets for different visualization styles
Troubleshooting
Vector not appearing?- Verify the target property is a Vector2 type
- Check that the vector has a non-zero value
- Ensure
show_vectorsis enabled in settings - Press Shift + V to toggle visibility
- Double-check the property name spelling
- Ensure the property exists and is exported or public
- Verify it’s a Vector2, not Vector3 or other type
- The addon automatically optimizes rendering by only redrawing when the vector changes
- For many vectors, consider reducing the update frequency in your game logic
