My character gets knocked back when i shoot.

I’m trying to make boundaries for my game.

Normally, the Player has a kinematic rigidbody2D which works fine, but for the walls I need to set the body type to “Dynamic” or the walls will let the player go through it.

When I put my player body type to 'Dynamic", he gets knocked back randomly when he shoots, so I cannot make it as a feature for the game that would look like a dash.

So how do I make my Player hit a wall without having him dashing?
alt text

I have read on the unity docs page that I need to put full kinematic contact, but still when I do so the player just goes through my wall.

This is the picture for Layer Collision Matrix

It sounds like perhaps the bullet you are firing is colliding with the player and causing the dashing you describe.
Try amending the code where you instantiate the bullets to something like the below to see if it fixes it:

Transform bullet = Instantiate(bulletPrefab) as Transform;
Physics.IgnoreCollision(bullet.GetComponent<Collider>(), GetComponent<Collider>()); }

I found it, I went in Layer Matrix (Which means no code is required to fix this problem :D)

 [To reproduce]

 Edit > Project Settings > Physics 2D > Layer Collision Matrix 

 In that part, you can choose which layers can collide with each layers, so I created 2 new layers: My Player layer (which I'll assign to my Player) and my Bullet layer (which I'll assign to my bullet).

 So go on your Player or your Bullet and click on "Layer", then click on "Add layer..." And write 2 new layer with the name of the objects you are assigning them to. (For example I need these on my bullet and my player so I created a player and bullet layer. As seen in the pictures below.)

alt text

 Then you go on the game object (For me Player and Projectile) and then click on "layer" just like earlier and assign them their respective Layers.

 When you are done you wanna go to Edit > Project Settings > Physics 2D > Layer Collision Matrix and in there you will uncheck the box that faces "Player" and "Bullet". 

(First picture of my comment, because I cannot add any other pictures to this message)

 (Tell me if you don't understand I might be able to answer you, though I'm not really good at explaining)