Hello all! I am currently working on the 2D RPG combat course. We are adding a knockback effect so that when we swing at enemies, they get pushed back a bit. To do this , we are using this line:
rb.AddForce(difference, ForceMode2D.Impulse);
In this situation, “difference” is a Vector2. To calculate difference, we are using this line:
Vector2 difference = (transform.position - damageSource.transform.position).normalized * knockBackThrust * rb.mass;
I wanted to ask what exactly the purpose is for normalizing our Vector2 in this instance. What would happen if we were not to normalize it? Any clarification would be appreciated. Enjoying the course so far!!