Skip to content

stopFollow() throws Cannot read properties of null Error #6508

@francois-dibulo

Description

@francois-dibulo

Version

  • Phaser Version: 3.6.0
  • Operating system: Mac Ventura 13.2
  • Browser: Tested on Chrome 113

Description

Calling gameObject.stopFollow() throws an error:

TypeError: Cannot read properties of null (reading '0')
    at PathFollower.pathUpdate (PathFollower.js:364:1)
    at PathFollower.preUpdate (PathFollower.js:71:1)
    at UpdateList.sceneUpdate (UpdateList.js:156:1)
    at EventEmitter.emit (index.js:203:1)
    at Systems.step (Systems.js:362:1)
    at SceneManager.update (SceneManager.js:574:1)
    at Game.step (Game.js:498:1)
    at TimeStep.step (TimeStep.js:727:1)
    at step (RequestAnimationFrame.js:91:1)
    at spector.bundle.js:1:594101 Array(0)

Example Test Code

You can reproduce the error in the official labs example:

https://labs.phaser.io/edit.html?src=src/paths/followers/pause%20and%20resume.js

Replace:

lemming.pauseFollow(); with lemming.stopFollow();

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions