/// <summary> /// make the soul move to the position on the checkpoint. /// set all soul variables that are needed for this action. /// enable all collisions. /// </summary> /// <param name="player"></param> private void SetSoul(Player player) { Soul soul = player.gate.collectedSouls[player.gate.collectedSouls.Count - 1].GetComponent <Soul>(); foreach (Collider c in soul.GetComponents <Collider>()) { c.enabled = true; } player.gate.collectedSouls.RemoveAt(player.gate.collectedSouls.Count - 1); player.gate.soulsCollected--; soul.soulMovement.moveTransform = soulPoints[index]; soul.soulMovement.onPlayer = false; soul.soulMovement.collected = false; soul.soulMovement.onCheckpoint = true; soul.soulMovement.moveTowardsObject = true; soul.transform.SetParent(null); soul.soulMovement.moveToCheckpoint = true; soul.transform.rotation = Quaternion.Euler(0, 0, 0); collectedSouls.Add(soul); index++; }