Skip to content

createFromObjects() doesn't copy custom properties #6391

@samme

Description

@samme

Version

  • Phaser Version: 3.60.0-beta.18

Description

For example giving an Object a property of alpha: 0.5 in Tiled will be reflected in the Game Object that is created.

This happened in v3.55.2 but it doesn't happen now.

Example Test Code

https://labs.phaser.io/edit.html?src=src/3.60\tilemap\create%20from%20objects.js&v=3.60.0-beta.18

const coinObject = this.map.objects[0].objects[3];

console.assert(coinObject.properties.alpha === 0.25);

const [ coin ] = this.map.createFromObjects('Coin Object Layer', [
    { id: coinObject.id, key: 'coin' }
]);

console.assert(coin.alpha === 0.25, 'Coin sprite should have alpha 0.25 not %s', coin.alpha);

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