Transform
2025/12/27
- Type
- Learning Resource
- Format
- Glossary Article
- Version
- General
- Subject Tags
- Created
- Updated
- 2026/02/16
- 2025/12/27
A transform is a mathematical representation that combines position, rotation, and scale into a single data structure. It defines where an object is placed and oriented in 2D or 3D space, as well as its size.
Rather than storing these properties separately, a transform uses a matrix (a grid of numbers) to represent them all at once. Transforms are used under the hood by game engines to efficiently calculate the final position, rotation, and scale of objects in the running game, with much better performance than if they were calculated separately.
In Godot, every Node2D and Node3D has a transform property:
Concretely, a transform is made up of the following components:
Working directly with transforms is common in 3D space because the position, rotation, and scale of an object are often interdependent. Very often, you want to move 3D characters in the direction they are facing, and for that we use the transform's basis vectors (the object's orientation axes).
Here's a minimal example of moving a character forward along its own negative z-axis (forward direction) in 3D:
func _physics_process(delta: float) -> void:
const MOVE_SPEED := 5.0
var forward_direction := -transform.basis.z
position += forward_direction * MOVE_SPEED * deltaDon'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…