-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Closed
Labels
Description
calling Phaser.Physics.Matter.Sprite.setScale(...)
also resets the rotational inertia
Version
- Phaser Version: Phaser v3.60.0-beta.18
- Operating system: Windows 10
- Browser: N/A, tested on chrome and firefox
Description
calling Phaser.Physics.Matter.Sprite.setScale(...)
also resets the rotational inertia
When setting up matter bodies, we have to first set scale and then call setFixedRotation, otherwise setFixedRotation has no effect
Example Test Code
To demonstrate, open this example: https://labs.phaser.io/edit.html?src=src/physics/matterjs/fixed%20rotation.js
and add this to line 34: block.setFixedRotation(); block.setScale(0.7);
Notice how the box rotates
if you instead switch the sequence block.setScale(0.7); block.setFixedRotation();
Notice how the box does not rotate as expected