// Update is called once per frame void FixedUpdate() { if (train) { num++; if (num > 25) { num = 0; train.heal(1); } if (train.getHealth() >= train.getMaxHealth()) { redGlow.SetActive(false); greenGlow.SetActive(true); } } }