See all glossary terms

Forward Direction

In computer graphics, elements' position, scale, and rotation are defined in a local coordinate system. This is often called "transform", or "basis" in 3D.
What does a 'local coordinate system' mean?
A local coordinate system is a system that moves with you. For example, your left and right side are always the same, no matter which direction you're facing. North, south, east, and west are a global coordinate system, while left, right, front, and back are your local coordinate system.
The forward direction is the direction in which an object is facing. This is often used to move an object in the direction it is facing, without having to know its angle.
For example, to move a bullet in the direction it is facing in 2D, you can use the following code:
var speed := 1000.0

func _physics_process(delta: float) -> void:
	position += transform.x * speed * delta
With this, you only need to orient the bullet once, and it will then move in that direction forever. By convention, transform.x is the forward direction in 2D (at least if you draw assets to face right by default).
In 3D, in Godot, the forward direction is the basis.z vector by convention. Here's an example of how to move an object in the direction it is facing in 3D, assuming the 3D model faces forward along the Z axis:
var speed := 10.0

func _physics_process(delta: float) -> void:
	var motion := basis.z * speed * delta