public void TakeHit(AttackInfo aInfo) { if (!invulnerable) { TakeDamage(aInfo.attackPower); flinched = true; flinchCooldown = 0.5f; aniscr.Flinch(); invulnerable = true; invulnerabilityTimer = 1f; //Stop player movement playerRigidbody.velocity = Vector3.zero; //Push player playerRigidbody.AddForce(aInfo.forceVector, ForceMode2D.Impulse); if (aInfo.element == Element.POISON) { Poison(); } } }