void OnCollisionEnter(Collision other) { if (Mathf.Abs(other.relativeVelocity.y) > 2f) { gameObject.GetComponent <SpriteRenderer>().sprite = _damagesprite; } if (Mathf.Abs(other.relativeVelocity.y) > 10f) { Destroy(this.gameObject); _audio.PigHurt(); } }