Question by
$$anonymous$$ · Feb 06, 2021 at 01:57 PM ·
2d game2d-platformerknockback
2D Player Knockback
Hi, i am trying to add knockback to my player(when player get hurts) my problem is knockback working just upwards my code:
player.GetComponent<Rigidbody2D>().AddForce(transform.up * 500 + transform.right * 500);
same code for enemy knockback works fine. idk what should i do? Thanks.
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613024701im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
how to make knockback and slowmotion when hit by enemy 0 Answers
Tilemap doesn't showing on window?? unity 5.6.1f1 ,Tilemap not showing on the Window or as 2D Object 0 Answers
2D movement with gravity shifting 0 Answers
hi i want to add a slid and wall jump to my script with animation, i am lost ^^ 0 Answers
How do i flip my character in 2D platformers,Im at a loss on flipping my 2D character 0 Answers