// Upon Collision TODO: is this still needed? /*void OnCollisionEnter() * { * Vector3 v3PreviousPos = transform.localPosition; * transform.parent.position = transform.localPosition; * transform.position = v3PreviousPos; * } */ void OnCollisionEnter(Collision a_collision) { if (a_collision.gameObject.tag == "Weapon") { Debug.Log("PC: HIT"); health -= 20; dizzyBirds.Play(); float healthFraction = 1.0f - (float)health / 100; healthFraction = Mathf.Lerp(0, 5, healthFraction); int healthImageID = Mathf.FloorToInt(healthFraction); healthBars.healthHit(m_playerID, healthImageID); } }