Jump to content

1.1.4: Tilemap.putTile() does not cause collision info to be updated


Recommended Posts

calling putTile() calls calculateFaces(), but this does not set the collision information on the existing tiles


which means that once you change a tile to a value that collides differently the face information for the map is broken - sprites can get 'inside' the faces etc


entered github issue #371 :)


Link to comment
Share on other sites

  • 2 weeks later...

I was having this problem too. Although having used the fill method to change tiles instead of putTile. I found that if I made another call to setCollision after making the change then the collisions would work correctly.


So something like:

tilemap.fill(1, 0, 0, 10, 10, 'ground_layer');
tilemap.setCollision(1, true, 'ground_layer');
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...