Skip to content

Container.getWorldPoint() / getLocalPoint() throw "tempMatrix.applyITRS is not a function" in 4.2.1 #7388

Open

Description

@DreadKnight

Description:

Phaser 4.2.1: Calling container.getWorldPoint(x, y) or container.getLocalPoint(x, y) throws:
TypeError: tempMatrix.applyITRS is not a function at Container.getWorldTransformMatrix (Transform.js:517) at Container.getWorldPoint (Transform.js:627) at Container.getLocalPoint (Transform.js:584)

Root cause: getWorldTransformMatrix() creates new TransformMatrix() but the instance lacks applyITRS at runtime (method exists in source but not on constructed object).

Minimal reproduction:

const container = scene.add.container(100, 100);
const sprite = scene.add.sprite(50, 50, 'key');
container.add(sprite);
container.getWorldPoint(0, 0);  // throws
// or
container.getLocalPoint(200, 200);  // throws

Environment: Phaser 4.2.1, WebGL renderer, TypeScript project, OS: Kubuntu

Workaround: Manual transform walking up parentContainer chain
See getWorldPointManual/getLocalPointManual in this commit: FreezingMoon/AncientBeast@516f4b41

Activity

  1. samme commented on Sep 30, 2026

    @samme
    Contributor

    This should work without errors:

    container.getWorldPoint()
    container.getLocalPoint(200, 200)
  2. vtxe02023274 commented on Oct 21, 2026

    @vtxe02023274

    getWorldPoint doesn't take x and y
    its signature is getWorldPoint(point, tempMatrix, parentMatrix) and it returns the object's own world position
    so getWorldPoint(0, 0) passes 0 as tempMatrix and that's the applyITRS is not a function
    it only shows up when the object is inside a container because that's the only path that touches tempMatrix

    checked against master with a container inside a container at (100,100) and (50,50):

    getWorldPoint(0, 0)       -> tempMatrix.applyITRS is not a function
    getWorldPoint()           -> { x: 150, y: 150 }
    getLocalPoint(200, 200)   -> { x: 50, y: 50 }
    

    to turn a local point into world space:

    const p = container.getWorldTransformMatrix().transformPoint(x, y)

    getLocalPoint(x, y) is the right call the other way round and works here
    if it still throws for you can you paste the exact call

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions