Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

In Build TilemapCollider2D colliders not working

Discussion in '2D Experimental Preview' started by histamine, Feb 28, 2017.

  1. histamine

    histamine

    Joined:
    Jan 2, 2016
    Posts:
    4
    Hello,

    I am using the latest release of the 3rd Experimental Preview release.

    The colliders from the default TilemapCollider2D script work fine in editor but when I build a standalone .exe and run it everything falls through the tiles. One workaround I have found is to attach an empty gameObject prefab with 2d box collider to the tile.
    Am I missing something? Is there a real 'fix'?

    Thank you
     
  2. Johaness_Reuben

    Johaness_Reuben

    Joined:
    Jan 27, 2016
    Posts:
    253
    Sounds like something is not working right. Will look into it. Thanks for testing it out.
     
  3. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,333
    Unfortunately, what you've got there isn't the latest in development and the TilemapCollider2D is way out of date in the current release. It's had a lot of work on it since then including major updates in how it handles incremental changes, now being able to make changes to only individual tile shapes (there can be many physics shapes per tile) as well as doing the same when using the CompositeCollider2D.

    I believe the issue you're seeing though is that outlines for sprites isn't available on a texture that isn't marked as readble at runtime i.e. we cannot access the texture to figure out the physics shapes. If you create a manual physics shape in the editor then that is fine, it's the ones that are automatically generated from the texture that might be the problem.

    You can mark the texture as readble in the importer and it'll work at runtime however know that this forces the texture to be in main memory so you need to be careful.

    We're looking into auto-baking of the shapes for ones being generated on the fly so you won't need this step in the future.
     
  4. Jonathan-Westfall-8Bits

    Jonathan-Westfall-8Bits

    Joined:
    Sep 17, 2013
    Posts:
    252
    You said there has been a lot of work on the system since the current release. I really don't care about the timeline of the release, but I was wondering if you could tell us what has been added, changed, removed, and what the current plans for the new 2D tools are. I am sure everyone would be excited for a possible news update of what has been done over the past few weeks. Thank you for your hard work too.