Search Unity

2D Alpha Release 3

Discussion in '2D' started by ColossalPaul, Aug 14, 2015.

  1. AssembledVS

    AssembledVS

    Joined:
    Feb 23, 2014
    Posts:
    248
    I asked this question to hopefully get an idea of how I should be implementing my collisions right now, in anticipation of Unity's own Tilemap system. When you say physics details from an individual tile, I'm assuming that 2D collisions would be a part of this. If so, what would the difference be between accessing the collider and accessing "just" its physics details?

    I think that checking whether collision is happening with an individual tile's collider, for example, would be sufficient for me, at least right now.

    If, say, a 3x3 grid of colliders is merged into one collider, would I be able to check whether the middle tile's collider is being collided with?

    Tiled2Unity currently merges all PolygonCollider2D tiles into one big collider, without the possibility (it seems), at least without custom scripts, of getting collision information from any individual tile (there are no more individual colliders once merged). Tiled2Unity, however, does not merge EdgeCollider2D tiles into one big collider; they are connected, but separate collider objects accessible via script and the Inspector.

    I guess I'm looking for behavior in which the user has a choice between merging the colliders and letting them be their own individual colliders.
     
  2. bluefoxicy

    bluefoxicy

    Joined:
    Jan 2, 2015
    Posts:
    15
    I see mention of TileMap Runtime APIs. Am I to take it that TileMap allows programmatic access, which would allow for such things as in-game tile level editors up to and including supplying tile brushes?
     
  3. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    It is possible that the tile map's collider may just contain the optimised collider information, so certain details could be lost, eg. for two square tiles side by side, the joining edge may be removed from the tile map's collider. If you consider the individual square tile's details alone, it would still have all four edges.

    We do hope to provide collision information such that if you are notified that you have collided with the tile map's collider, you will be able to identify the tiles that you have collided with by position. At the high level, you know you have collided with the tile map and after that, with some script calls to the tile map/collider, you can also find out which tile/s have been hit.

    Yes, we will take this into consideration.
     
  4. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Yes, you will be able to add and remove tiles and change tile properties programmatically during the runtime. The in-game tile level editor will be possible, although you may need to provide the UI handling as the runtimes do not come with the Unity Editor features. Tile brushes could be possible as well with the same runtime limitations.
     
  5. AssembledVS

    AssembledVS

    Joined:
    Feb 23, 2014
    Posts:
    248
    Thanks for the explanation and update! Very excited for Unity's Tilemap implementation next year.