Knockback not working

Hi, I have tried all solutions offered on similar questions, but nothing seems to work. Been trying to accomplish the seemingly minor task of an effective knockback for about an hour. Through Debug.Log, I know the collision registers, but somehow, the enemies simply push the player character around instead of applying knockback. Here is my code:

	void OnCollisionEnter2D (Collision2D other)
	{
		if (other.gameObject.tag == "Player") {
			other.gameObject.GetComponent<Player> ();

			if (Player.invincible == 0 && charm == false) {

				Vector2 dir = other.contacts [0].point - (Vector2)transform.position;
				dir = -dir.normalized;
				Debug.Log (dir);
				Player.rb2d.AddForce (dir * knockbackForce);
				Player.OnHit (); 
			}
		}
	}

Any help very appreciated :slight_smile:

Hello!

I’m not used to use physics in my projects, but is possible the AddForce needs (Vector2 , Force.mode) and not (Vector2 * Force.mode) ?