Clipping Trough Walls

Hi, my character keeps clipping trough walls (i am talking about unity 2d).

Here is the part of the script that makes the problem:

transform.Translate(new Vector2(Input.GetAxis(“Horizontal”), Input.GetAxis(“Vertical”)) * 5 * Time.deltaTime); // Five wont show up correctly due to the unity forum markdowns

Idk how to solve this, I tried everything: changing collision detection form discrete to continuous, changing interpolation from none to extrapolate, adding rough material to the ground, but nothing seems to work, I still get that weird clipping. Please answer me as soon as possible, I’m in game jam that ends on Saturday in 12:00

I think it is the way you move the character, you can attach a rigidbody on to the character and use:

        if (movement !=
            rb.MovePosition(rb.position + movement);

If you don’t want to be affected by collisions or gravity, set some constraints. Good luck!