Version
- Phaser Version: 3.52.0
- Operating system: macOs Catalina 10.15.7
- Browser: n/a
Description
Phaser.Physics.Matter.Image and Phaser.Physics.Matter.Sprite's setToSleep and setAwake functions should return this.
https://github.com/photonstorm/phaser/blob/v3.52.0/src/physics/matter-js/components/Sleep.js#L19
(Maybe just add return this as the last lines in each function?)
Not having this breaks people chaining calls.
Example Test Code
this.image = scene.matter.add.image(0, 0, `main`, `game/ball`)
.setToSleep() // Bug - doesn't return the instance
console.log(`GameBall.js: this.image:`, this.image) // undefined
Additional Information
Yay.