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

2D " Wall " Colliders not working

Discussion in '2D' started by ARLC-753, Aug 9, 2021.

  1. ARLC-753

    ARLC-753

    Joined:
    Feb 2, 2021
    Posts:
    9
    I want to create some "walls", but for some reason I have tried everything and the player will simply not collide with any wall I create; I saw some youtube videos to see If I needed to do something that isn't basic, but they do absolutely nothing out of the ordinary.

    I mean, a collider should collide with other collider supposing that neither is a trigger, it's supposed to be very simple but like I said my player doesn't collide with any walls, only with ground but not walls.

    Yes, the walls are not set to "trigger"

    There must be something that makes collisions with the ground possible but not with walls, I would appreciate some help if you know some probable causes, thank you.
     
  2. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    10,620
    There's no such thing as a "wall" or "ground" when discussing physics because they are notional things in your project.

    Reduce the description of your problem to describing the actual physics components (Colliders) you're actually using including the Rigidbody2D descriptions too (what body-types are they for instance)? Make sure the Colliders are on a GameObject with Layers assigned that are set to actually collide (look in the Physics 2D Settings > Layer Collision Matrix).

    By default on a new project, everything is set to collide with everything so unless you've changed it, it'll work. It won't work if you are expecting Static (non-moving) Colliders to contact other Static Colliders because they don't collide.

    Just provide more info then I can help you.
     
  3. ARLC-753

    ARLC-753

    Joined:
    Feb 2, 2021
    Posts:
    9
    Let me play around the settings you are saying and I'll get back to you, basically the player doesn't collide with other colliders where I want him to collide (I used walls as an example beacuse I want these "walls" to prevent him from moving pass them, but he does move pass them which is not intended)