Player going through walls

Hello everyone. i searched the whole internet and found no answer.
so i’m gonna ask here.
i have my player which is moved by this part of the script:
Player.GetComponent().AddForce(Player.transform.forward * 20);

The player has a rigid body on him.
the rigid body is not kinematic but has disabled gravity.
In that part of the script i want my player to keep going forward and he does. but he goes into walls.

And i can’t move my player with the character controller move option, because i disabled my character controller because i need to move my player on the y axis and the character controller doesn’t allow that.

Make sure you also have some type of collider on your player, be it a box collider or capsule collider (most common for characters), etc… What a Rigidbody does, is essentially adds physics to an object, the collider will allow those physics to be affected by the world or anything that should essentially have a “mass” of some type to it.

The object you are colliding with (in your case, the walls) should also have the same idea on them, at least a Rigidbody, and its always a fail-safe to add a collider as well, cause most often, you are missing one or the other on one of the 2 objects you are trying to get to collide properly.