Answer the question
In order to leave comments, you need to log in
Physics engine Unity2d. How to make a rebound?
It is necessary to make an elementary rebound of the character when receiving damage.
I was able to make the following code:
if (collision.gameObject.tag == "Vrag")
{
gameObject.GetComponent<Rigidbody2D>().AddForce(transform.up * direction * powerForce, ForceMode2D.Impulse);
TakeDamagee();
hpText.text = ((int)hp).ToString();
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question