// Update is called once per frame void Update() { if (!isFinished) { progress += Time.deltaTime; transform.localPosition = shipPath.transform.InverseTransformPoint(shipPath.GetPathPoint(progress, out isFinished)); } if (isFinished) { Death(); } if (currentHealth <= 0) { // ToDo Add points to player Death(); } }