How do I stop the player from going through walls? (2D) [CLOSED]

I’m using Unity 5.6.1f1 and the title is my question.

Here are my prefabs:

I’ve turned on the box collider and checked “Is Trigger” and used the rigidbody:

But the player is still going through walls. How do I prevent this?

I need “Is Trigger” on for my OnTriggerEnter function in a c# script

1st off you need a 2d box collider and a 2d rigidbody. And then Is trigger needs to be off. When a collider is checked trigger it no longer stops collisions.