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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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