Search Unity

Player sticks to wall

Discussion in '2D' started by Kadum1013, Sep 27, 2020.

  1. Kadum1013

    Kadum1013

    Joined:
    May 19, 2018
    Posts:
    10
    Hello all, I am very new to unity plus coding.
    I have run into a rough spot, I am making a simple 2d platformer game.
    My player keeps getting stuck to the walls :/.

    I am using a Rigidbody2D with velocity for the movement.
    I tired adding/changing a physics material, both putting it on the player and on the ground.
    The player either wont stop sliding around or it does nothing. I tired coding it to change the material every time it hits a wall but no dice... I tired adding a downward force when the player touches the wall but again no dice.
    I have tired looking all over the internet for a solid week now. Every video I find talks about add a physics material and changing it to 0 but that doesn't seem to work for me for some reason and I can't figure out why.

    I can post my code but again I am very new it maybe hard to read my work (Trying to work on it)

    I started looking in to add a slide effect when in the air and on the wall but just started looking into that but also decided to post on here and see if I can at least be pointed in the right direction.
    Any help would be very much appreciated!

    Thank you! :D
     
  2. DiegoDePalacio

    DiegoDePalacio

    Unity Technologies

    Joined:
    Oct 28, 2009
    Posts:
    507
  3. Kadum1013

    Kadum1013

    Joined:
    May 19, 2018
    Posts:
    10
    Thank you! I will check them out. Much appreciated!
     
    DiegoDePalacio likes this.