Basis
2025/12/27
- Type
- Learning Resource
- Format
- Glossary Article
- Version
- General
- Subject Tags
- Created
- Updated
- 2026/02/16
- 2025/12/27
In 3D space, a basis represents the rotation and scale part of a transform. It defines an object's orientation and size through three perpendicular vectors (axes) that form a coordinate system: the object's own x, y, and z axes.
You can think of a basis as describing "which way is up, right, and forward" for an object in your 3D world. You can also stretch or shrink these axes to scale the object along each direction.
The basis is represented by the Basis type in Godot. All 3D nodes have a basis property that you can access and modify to change the object's orientation and scale (this is a shortcut for transform.basis, which is the same value).
The basis has three Vector3 properties accessible like this:
basis.x: The right direction (x-axis)basis.y: The up direction (y-axis)basis.z: The forward/back direction (z-axis)Here's an example showing a common way to use the basis to move a character in 3D space. Here the character can move forward and back or strafe left and right based on its orientation:
func _process(delta: float) -> void:
var direction: Vector3 = Vector3.ZERO
if Input.is_action_pressed("move_forward"):
direction -= transform.basis.z
if Input.is_action_pressed("move_backward"):
direction += transform.basis.z
if Input.is_action_pressed("move_right"):
direction += transform.basis.x
if Input.is_action_pressed("move_left"):
direction -= transform.basis.x
direction = direction.normalized()
position += direction * speed * deltaIt's helpful to visualize the basis as the three colored axes you see when you select an object in the 3D editor. When you rotate an object, you're actually rotating these axes. When you scale it, you're changing the length of the axes.
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…