Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Collision with box collider not working.

Discussion in '2D' started by julpaquin23, Mar 14, 2016.

  1. julpaquin23

    julpaquin23

    Joined:
    Feb 1, 2016
    Posts:
    1
    Hey guys, I am working on a 2d platformer and I have found a weird issue with the corner of the box collider. My Player is made of a polygon collider and when my player lands onthe corner of the box collider or if I slowly walk to the corner of the box collider, my player just hovers over the corner and get stuck there. There seems to have a gap between the two collider when there shouldnt be. If somebody as had a problem similar to that with the corner of the box collider I would love to hear what you have done to solve the problem.

    thanks for your help
     
  2. Zaflis

    Zaflis

    Joined:
    May 26, 2014
    Posts:
    438
    Is the polygon convex shape? I didn't check if the collider supports concave, but if it doesn't you may need to split it to more colliders.
     
  3. geek_freek

    geek_freek

    Joined:
    Aug 26, 2014
    Posts:
    51
    Well if this is what i think it is then the problem is itself with BoxCollider2D , instead of BoxCollider2D make the whole surface as EdgeCollider2D. Here is something for in-depth info. Discussions on this topic have been done here.