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

Iso collision box

Discussion in '2D Experimental Preview' started by vincismurf, Dec 4, 2016.

  1. vincismurf

    vincismurf

    Joined:
    Feb 28, 2013
    Posts:
    200
    Is there a way to add isometric collision shapes like box and spheres?
     
  2. Johaness_Reuben

    Johaness_Reuben

    Joined:
    Jan 27, 2016
    Posts:
    253
    Currently no plans for that.
     
  3. vincismurf

    vincismurf

    Joined:
    Feb 28, 2013
    Posts:
    200
    If we don't have Isometric collision shapes than what good is having an Isometric tilemap? How would we determine if we collide with gameobjects, triggers etc in the tilemap?
     
  4. jc-drile77

    jc-drile77

    Joined:
    Jul 1, 2014
    Posts:
    230
    Polygon Collider 2D should do the trick.
    Having said this, I would also like to get these features some time in the future. :)
     
  5. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,333
    If you're talking about 2D then a tile can have any collision shape. I suspect however you're talking about something else, possible asking about how to do pseudo 3D collisions.

    Can you elaborate on what you want.
     
  6. vincismurf

    vincismurf

    Joined:
    Feb 28, 2013
    Posts:
    200
    Ok,

    Right now I am using the the Isometric 2.5d Toolkit ( https://www.assetstore.unity3d.com/en/#!/content/27851 ), but the performance is less than ideal.

    The developer created some isometric collision code ( http://matov.me/2015/09/07/isometric-2-5d-toolset-documentation/ ) ISOBox/Sphere/Capsule etc. I can use them for trigger collisions or with rigid-shapes for walls.

    However each of these objects are specialized gameobjects, as of such, using his system to build an isometric world incurs a lot of overhead. Ideally I would prefer to use the new tilemap system and add iso collision shapes into the tilemap.

    For an example try my Proof of Concept

    http://afterschoolcartoons.ipower.com/Games/ZALS/index.html

    ( WASD - controls, You'll might notice a minor hitch when a new scene is async loaded with only a few more sprites added the scene)

    PS
    Melv great to see they picked up up, you did great work with T2d!
     
  7. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,333
    So you can set a collision shape that sits at the base of each ISO cube as well as your character (diamond shape). This would allow you to use collisions along a single plane.

    Alternately, you don't have to use 2D physics at all and just maintain an 'occupancy' flag for each ISO cube and test that before/after you move into that space.

    We could look at supporting a simple occupancy set-up where each tile is simply flagged and then provide simple checks for you but that's easy for you to do as well however you can do that already yourself using the 'GridInformation' class where you can quickly associate a tile position with various values. One of those values could be a simply occupied flag or something more complex such as describing empty or what it contains, even an object reference.

    The thing is, the GridInformation type in the experimental will more than likely be open-source as it's just a dictionary in the end.

    For basic information, you can use a hidden tile-map that contains flags as well

    Thanks! :)
     
    Last edited: Feb 22, 2017
  8. vincismurf

    vincismurf

    Joined:
    Feb 28, 2013
    Posts:
    200
    I'll look into it. GriInformation Class is news to me =)