private void CheckActionForPoint() { switch (idxPoint) { // Player start location and end location when rejected case 0: // Rejected destroy this if (!path) { doorController.EntryDoor(); gameplayController.SpawnCharacter(); Destroy(gameObject); } doorController.EntryDoor(); break; case 1: // Close Door doorController.EntryDoor(); break; case 2: // Stop player movement until next command characterAnim.SetBool("isWalking", false); if (!decision) { gameplayController.allowToChoose = true; gameplayController.GiveCard(); StartCoroutine(patientClock()); } if (path) { allowMovement = false; } break; case 3: // Stop player movement until next command doorController.SecurityDoor(); break; case 4: // Close the door and destroy this doorController.SecurityDoor(); gameplayController.SpawnCharacter(); Destroy(gameObject); break; } if (path) { idxPoint += 1; } else { idxPoint -= 1; } }