kurisubrooks Posted September 1, 2016 Share Posted September 1, 2016 Hi there. I'm an experienced JS dev looking to get into Game Development. I've started out with a fairly small top-down "rpg" style game. I'm used the program "Tiled" to create the world map. So far i've been following this tutorial to get started, learn the basics of Phaser, but now i'm unfortunately running into this problem. This tutorial is about 2 years old, and uses it's own "object" generator, however i'd really like to use Phaser's native `.createFromObjects` function. My code is as follows; this.map = this.game.add.tilemap("world"); this.map.addTilesetImage("sheet", "spritesheet"); let map = this.map; let objects = this.game.add.group(); objects.enableBody = true; this.map.objects.objects.forEach(function(element) { map.createFromObjects(element.name, element.gid, element.properties.sprite, 0, true, false, objects); }); The error I receive in the console; Tilemap.createFromObjects: Invalid objectgroup name given: goldCoins Tilemap.createFromObjects: Invalid objectgroup name given: playerSpawn Tilemap.createFromObjects: Invalid objectgroup name given: goldCoins Tilemap.createFromObjects: Invalid objectgroup name given: campFire Tilemap.createFromObjects: Invalid objectgroup name given: stool Tilemap.createFromObjects: Invalid objectgroup name given: sign I've cut out the majority of the code for sake of saving space in this forum post,but the full code is available here. I've already looked up multiple forum posts, each with their own solutions to fix the bug i'm experiencing, however none have worked. I've tried replacing the "groups" param with the Tiled object's name, as per this post, but i'm unable to find a fix for this. I'd appreciate any help anyone may provide for me. Link to comment Share on other sites More sharing options...
kurisubrooks Posted September 1, 2016 Author Share Posted September 1, 2016 Gave up. Came to the conclusion that it's just not possible, Phaser must have a bug or something. Wrote my own function to spawn in Objects, because that was too god damn awful. Link to comment Share on other sites More sharing options...
Recommended Posts