Search Unity

[Solved] Composite Collider 2D grid polygon generation issue

Discussion in 'Physics' started by Chrizerk, Apr 28, 2019.

  1. Chrizerk

    Chrizerk

    Joined:
    Feb 10, 2015
    Posts:
    2
    So I'm trying to dynamically destroy the tiles of 2 grids when they collide, but the polygon2d generation seems to be off. Its leaving behind lines where the tiles got destroyed. I'm not sure why this is happening, any ideas on how to get the grid to generate properly?
    Capture.PNG

    This is the script that I have attached to both tilemaps
    BreakOnCollision.cs
     

    Attached Files:

  2. Chrizerk

    Chrizerk

    Joined:
    Feb 10, 2015
    Posts:
    2
    Not sure if its the best solution, but its resolved by disabling the tile map collider, generating the polygons, enabling the collider, then regenerating the polygons again.
     
    chansinyow likes this.