Hello Guest

Author Topic: Collision detection on different layers  (Read 4201 times)

Brandon

  • Newbie
  • *
  • Posts: 2
    • View Profile
Collision detection on different layers
« on: October 26, 2013, 12:54:31 am »
Alright so I have a tilemap with different layers. My walls of my top-down game are the first layer (z = 0). The floor tiles are what the player can step on without having a collision (z = -2) and now i want to add a floor tile which will trigger an action. I put that on a trigger layer (z = -1). My player is a z = 0. How can i do a collision between a floor tile at z = -1 when my player is at 0? I tried putting the tiles at the same z layer but my player will occasionally disappear underneath.

Thanks in advance :D

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Collision detection on different layers
« Reply #1 on: October 26, 2013, 05:44:39 pm »
You can make the collider a lot deeper if needed if it can't physically touch another layer? If you need triggers one option is to add data prefabs - spawn them as a tile with a box collider trigger and use it that way.

Brandon

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Collision detection on different layers
« Reply #2 on: October 26, 2013, 06:09:55 pm »
Oh I think I get what you mean.. Thanks for the tip  ;D