void Update() { if (currentHealth <= 0) { currentHealth = 0; ResourceUI.AddBPoints(points); Destroy(gameObject); } }