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

BoxCollider2D on tiles in tilemap?

Discussion in '2D Experimental Preview' started by snackycactus, Nov 21, 2016.

  1. snackycactus

    snackycactus

    Joined:
    Aug 15, 2013
    Posts:
    27
    I know that collision is one of the less finished aspects of the 2D experimental preview release, but I'm wondering what anyone's thoughts are on being able to add box colliders to tiles in the pallet themselves. This way collision can be painted with the tiles rather than added separately.

    Does anyone know if anything like this is possible now?
     
  2. Xelnath

    Xelnath

    Joined:
    Jan 31, 2015
    Posts:
    402
    I think it's possible now if you create a collision tilemap of your own, then add a collider to the tile object you create :)
     
  3. Johaness_Reuben

    Johaness_Reuben

    Joined:
    Jan 27, 2016
    Posts:
    253
    You can define the shape for collisions using the Physics Shape Editor in the Sprite Editor. Colliders being components need to be added after.
     
  4. TSabos

    TSabos

    Joined:
    Mar 8, 2015
    Posts:
    94
    I think this is super important to get right.

    In TileD you can paint your collision layer separately.

    The idea would be to work it with Tilemap Collider 2D most likely so that it is 1 giant collider for all your treeline etc. It may give better control to put collision on every single tile, but in the end this can become very tedious.

    If I were to make a tilemap today with this set of tools, I'd probably instead just create a Collision Pallette with paintable tiles with GameObjects linked to them that specified the collider and type which of course goes against everything built into the tilemap system and also creates tons of individual colliders.

    I see that you have Collider Type on the Tile Asset, but that requires making assets for every single tile. What might make all this workflow easier is if you could click the tile in the Palette and it showed you the definition of the tile and ability to edit all its properties instead of trying to hunt down the tile asset. If there is no definition then the ability to create the asset.

    Hopefully once the tutorials come out it'll be easier to follow what the intended design ideas are behind all the madness ;)