Search Unity

Rigidbody2D.velocity problem with ground collision

Discussion in '2D' started by Gorki12, Aug 17, 2020.

  1. Gorki12

    Gorki12

    Joined:
    Jul 12, 2015
    Posts:
    73
    Hi,
    I have a problem with the movement of characters. It's sometimes blocked on the border of a ground collision. The collision I use is tilemap collider2D.

    I post screen how look this problem.

    Movement script:

    void Move()
    {
    float inputHorizontal = Input.GetAxisRaw("Horizontal");

    rigidbody2D.velocity = new Vector2(inputHorizontal * 4f, rigidbody2D.velocity.y);
    }
     

    Attached Files: