/** * possesses a new NPC. * - Has to move to that npc. Unparent current NPC from cam, make it visible again * - use the shift teleport movement to leave current npc body and move cam to new npc * - have to move entire tracking space * - parent new npc to cam * - make it not visible anymore * */ public void PossessNewNPC(GameObject npc) { if (currentNPC) { // unpossess npc unparentNPCFromCam(currentNPC); // reset old npc position currentNPC.transform.position = currentNPC.transform.GetComponent <NPC> ().center; oldCenter = currentNPC.transform.position; } else { oldCenter = this.transform.position; } finishedShifting = false; shifting = true; currentNPC = npc; newCenter = GetNewCenterOfTrackingSpace(currentNPC.transform.position); transition.StartFX(); moveSound.Play(); shiftCount++; // teleported for the first time // so remove teleport ui if (shiftCount == 1) { UIManager.Instance.TeleportedForFirstTime(); } }