You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I received the following error when calling this.animatedTiles.init
Uncaught TypeError: Cannot read property 'type' of null
What I found was that if there is a layer in the tile map JSON which has not been added to the map using Phaser APIs (createStaticLayer/createDynamicLayer) then that layer will not have a 'Type' property and the animatedTiles.init fails.
Since this plugin requires animated layers to by DynamicLayers I changed line of code 410 in AnimatedTiles.js from this:
if (layer.tilemapLayer.type === "StaticTilemapLayer") {
to this:
if ((!layer.tilemapLayer) ||
(!layer.tilemapLayer.type) ||
(layer.tilemapLayer.type === "StaticTilemapLayer")) {
This fixed my issue because my animatedTiles.js is ignoring all layers that are not dynamic however I wanted to share this in case others hit this issue.
The text was updated successfully, but these errors were encountered:
I received the following error when calling
this.animatedTiles.init
What I found was that if there is a layer in the tile map JSON which has not been added to the map using Phaser APIs (createStaticLayer/createDynamicLayer) then that layer will not have a 'Type' property and the animatedTiles.init fails.
Since this plugin requires animated layers to by DynamicLayers I changed line of code 410 in AnimatedTiles.js from this:
if (layer.tilemapLayer.type === "StaticTilemapLayer") {
to this:
This fixed my issue because my animatedTiles.js is ignoring all layers that are not dynamic however I wanted to share this in case others hit this issue.
The text was updated successfully, but these errors were encountered: