Vector
2025/12/27
- Type
- Learning Resource
- Format
- Glossary Article
- Version
- General
- Subject Tags
- Created
- Updated
- 2026/02/16
- 2025/12/27
In math, a vector is a list of numbers representing a direction and a length (called the vector's magnitude).
In math, vectors can be lists of numbers of any length, though in games, we mostly use vectors to represent 2D and 3D coordinates. So, we mainly use vectors with 2 and 3 numbers.
A 2D vector has two values representing the x and y coordinates, while a 3D vector has three values for the x, y, and z coordinates.
In Godot, vectors are essential for representing positions, velocities, and forces within a game world. We use them in scripts to control characters, detect collisions, and more. Godot provides two primary vector types: Vector2 for 2D, and Vector3 for 3D.
You can manipulate vectors with various operations, including:
Don't stop here. Step-by-step tutorials are fun but they only take you so far.
Try one of our proven study programs to become an independent Gamedev truly capable of realizing the games you’ve always wanted to make.
Get help from peers and pros on GDQuest's Discord server!
20,000 membersJoin ServerThere are multiple ways you can join our effort to create free and open source gamedev resources that are accessible to everyone!
Sponsor this library by learning gamedev with us onGDSchool
Learn MoreImprove and build on assets or suggest edits onGithub
Contributeshare this page and talk about GDQUest onRedditYoutubeTwitter…