Hello Guest

Author Topic: TileMapColliderBuilder2D creates an extra edgecollider point/vertex  (Read 3411 times)

andreasgan

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 5
    • View Profile
I've converted the TileMapColliderBuilder2D to build polygoncollider2ds instead of edgecollider2ds, but now each collider now has an extra point. I understand that this was required for edge (to create the last "wall" and close the collider), but now that I have poly, they automatically create the last wall.

Does anyone know how I can fix this right off the bat?

I don't understand all of the TileMapColliderBuilder2D code, especially not the part with making "verts" and "indices," so any hints as to where to look / what to google so that I can figure it out myself works too.

I attached some example screenshots below.
« Last Edit: January 27, 2015, 09:42:27 am by andreasgan »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: TileMapColliderBuilder2D creates an extra edgecollider point/vertex
« Reply #1 on: January 27, 2015, 11:15:50 am »
When assigning points to your collider, simply remove the last one. The algorithm works on edges, changing that won't be straightforward.

andreasgan

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: TileMapColliderBuilder2D creates an extra edgecollider point/vertex
« Reply #2 on: January 27, 2015, 11:35:27 am »
Haha thanks! That's so ridiculously obvious, I dont know why i didnt think of that myself!
Thank you :)