Transform

2025/12/27

Type
Learning Resource
Format
Glossary Article
Version
General
Subject Tags
Code
Assets
All else
Copyright 2016-2026, GDQuest
Created
2026/02/16
Updated
2025/12/27

Transform

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 * delta
Become an Indie Gamedev with GDQuest!

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.

Nathan

Founder and teacher at GDQuest
  • Starter Kit
  • Learn Gamedev from Zero
Check out GDSchool

You're welcome in our little community

Get help from peers and pros on GDQuest's Discord server!

20,000 membersJoin Server

Contribute to GDQuest's Free Library

There are multiple ways you can join our effort to create free and open source gamedev resources that are accessible to everyone!