Skip to content

setScale on matter bodies is resetting fixedRotation #6369

@sushovande

Description

@sushovande

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

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