Jump to content

Doubt createFromObjects


Recommended Posts


I have this error on console: 

Tilemap.createFromObjects: Invalid ObjectGroup name given: objects 


I had not used before "createFromObjects" so I do not really understand the reason for what I'm doing wrong. 

This is my code inspirated in @valueerror code:


            // map

            this.map = this.game.add.tilemap('level2_2');


            this.map.setCollisionBetween(0, 238);


            this.layer = this.map.createLayer('Level');

            // this.layer.debug = true;


            this.layer_tiles = this.game.physics.p2.convertTilemap(this.map, this.layer);


            this.customPlatform = this.game.add.group(); 

            this.map.createFromObjects('objects', 10, 'sprite', 10, true, false, this.customPlatform);

            this.customPlatform.forEach(setupMovingPlatforms, this);



            this.layerobjects_tiles = this.game.physics.p2.convertCollisionObjects(this.map, 'objects');  



Any help? 


A greeting.

Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...