Hi, I am trying to give my player knockback when I shoot a bullet left or right (when I shoot right the player is sent to the left and vis versa) but nothing I have tried has works however if I try up and down knockback it works. Also, when I start the game, I get knockback horizontally only at the very start and right after I wall jump the knockback works but only in those two instances, here is my full code for my player could someone please help: GDL Paste - yipogekixu
Replace line 220 with:
body.AddForce(new Vector2(horizontalInput * speed,0));
You may need to increase the player’s speed value after.
Also, replace GetAxis with GetAxisRaw on lines 78 and 79.