Skip to main content
GameTransform is the transform accessor attached to every GameObject. You reach it through GameObject.Transform or the Transform shortcut property on any Component. It exposes two coordinate spaces:
  • World space — absolute position, rotation, and scale relative to the scene origin.
  • Local space — position, rotation, and scale relative to the parent GameObject.
// From a Component
WorldPosition += Vector3.Forward * 100f;

// From a GameObject reference
go.WorldPosition = new Vector3( 0, 0, 100 );
go.Transform.World = new Transform( position, rotation, scale );

World space

World
Transform
The full world-space transform. Reading is cached and invalidated automatically when the transform changes. Writing recalculates the local transform to produce the desired world result.
go.Transform.World = new Transform( Vector3.Zero, Rotation.Identity, Vector3.One );
On Component, use WorldTransform, WorldPosition, WorldRotation, and WorldScale as shortcuts that read and write through GameObject.Transform.World.

Local space

Local
Transform
The full local-space transform — position, rotation, and scale relative to the parent GameObject. If the object has no meaningful parent (it is parented directly to the scene), local and world transforms are equivalent.
go.Transform.Local = new Transform( new Vector3( 0, 0, 50 ) );
InterpolatedLocal
Transform
The current interpolated local transform. During fixed update, this smoothly moves toward the target transform rather than snapping. Read-only — set Local or World to change the transform.

Understanding world vs local space

Local space values are always relative to the parent. If a parent object moves, all children follow automatically.
// Parent is at (100, 0, 0).
// Child's local position is (10, 0, 0).
// Child's world position is therefore (110, 0, 0).

var child = new GameObject( parent, true, "Child" );
child.LocalPosition = new Vector3( 10, 0, 0 );

Log.Info( child.WorldPosition ); // (110, 0, 0)
When you re-parent an object with SetParent( newParent, keepWorldPosition: true ), the world position stays fixed and the local transform is recalculated. With keepWorldPosition: false, the local transform stays and the object moves to its new position in the world.

Interpolation

When a GameObject’s transform is changed inside OnFixedUpdate, the engine smoothly interpolates it each render frame so movement appears fluid even at low physics rates. This is automatic and requires no extra code.

ClearInterpolation

public void ClearInterpolation()
Forces the object to snap immediately to its target transform, discarding any in-progress interpolation. Also notifies other clients on networked objects to do the same. Use this after teleporting or respawning an object so it does not visually slide from its old position.
protected override void OnEnabled()
{
    WorldPosition = SpawnPoint;
    Transform.ClearInterpolation();
}

Helper methods

LerpTo

public void LerpTo( in Transform target, float frac )
Linearly interpolates the world transform toward target by fraction frac (0 = no movement, 1 = snap to target). Useful for smooth camera or object following.
protected override void OnUpdate()
{
    Transform.LerpTo( _targetTransform, 5f * Time.Delta );
}

OnTransformChanged

public Action OnTransformChanged;
An event fired every time the transform changes, including when children of this object change. Subscribe to react to transform updates without polling.
protected override void OnAwake()
{
    Transform.OnTransformChanged += OnMoved;
}

void OnMoved()
{
    UpdateShadowPosition();
}

Practical examples

Moving an object every frame

protected override void OnUpdate()
{
    // Move forward at a constant speed
    WorldPosition += WorldRotation.Forward * Speed * Time.Delta;
}

Rotating around an axis

protected override void OnUpdate()
{
    WorldRotation = WorldRotation.RotateAroundAxis( Vector3.Up, AngularSpeed * Time.Delta );
}

Keeping a child fixed in world space while parenting

// Attach a hit effect to an enemy, but keep it at the impact point
hitEffect.SetParent( enemy, keepWorldPosition: true );

Teleporting without interpolation artifacts

void Teleport( Vector3 destination )
{
    WorldPosition = destination;
    Transform.ClearInterpolation();
}

Smooth follow using LerpTo

[Property] public GameObject Target { get; set; }
[Property] public float FollowSpeed { get; set; } = 4f;

protected override void OnUpdate()
{
    if ( !Target.IsValid() ) return;

    Transform.LerpTo( Target.WorldTransform, FollowSpeed * Time.Delta );
}

Build docs developers (and LLMs) love