Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

Box Collider 2D and Rigidbody 2D Stop Randomly While Moving Horizontally on Edge Collider 2D

Discussion in '2D' started by Nnanyere, Jul 7, 2022.

Thread Status:
Not open for further replies.
  1. Nnanyere

    Nnanyere

    Joined:
    May 10, 2022
    Posts:
    14
    I'm making a level editor where the ground tiles are separate GameObjects. I didn't want to make a tilemap because I wanted some of the ground tiles to move and disappear. When I placed multiple ground tiles (each with an Edge Collider 2D) on a flat plane, the Player sprite (with the aforementioned Box Collider 2D and Rigidbody 2D) can move left and right, but will randomly stop at the edge of a ground tile. If I jump or move left and right, the player sprite can pass, but this doesn't completely take care of the issue. Is there any reason and/or remedy for this (other than adding the ground tiles to a tilemap)?
    upload_2022-7-6_21-27-2.png

    upload_2022-7-6_21-27-57.png

    upload_2022-7-6_21-32-7.png
     
  2. MousePods

    MousePods

    Joined:
    Jul 19, 2012
    Posts:
    812
  3. karliss_coldwild

    karliss_coldwild

    Joined:
    Oct 1, 2020
    Posts:
    613
    Or increase the edge radius a little bit for the player character or ground tiles. Round corners or more likely to slide smoothly past each other than sharp ones.
     
    MousePods likes this.
  4. Nnanyere

    Nnanyere

    Joined:
    May 10, 2022
    Posts:
    14
    MousePods likes this.
  5. YaowenDev

    YaowenDev

    Joined:
    Mar 7, 2017
    Posts:
    3
  6. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,701
    Please use the "Like" button to show appreciation so you don't end up necroing the thread for everyone.

    Thanks.

    Thread Closed.
     
Thread Status:
Not open for further replies.