//TODO: Think about below void SetPlayerPositionForConversation() { //don't set positioning with eyeguards or helpful fish if (m_PersonRequestingToBeSpokenWith.CompareTag("Eyeguard")) {//Right now the rotation is all off when Liam interacts becasue the objects orientation and local vs world is off /* Interacting with the eyeguard might or might not happen only once : * In The stonehengeManager, * 0. We need to set Liams position close enough for animation to look like he's poking Eyeguard in the eye and disable input. * 1. We need to turn off our main cam and activate a fp eyeguard cam * 2. We need to trigger ReachForward * 3. Eyeguard UI needs to display an angry red "!?" symbol above head. * 4. We need to shutoff this camera and enable the stonehengeCam.... */ //animator.SetTrigger("ReachForward"); } else if (!m_PersonRequestingToBeSpokenWith.CompareTag("Tome")) //we dont set positioning for conversations with tomes..because we HATE tomes { //smoothly rotate the camera to the speaker thirdPersonCam.RotateCamera(m_PersonRequestingToBeSpokenWith.transform); //freeze him Rigidbody m_RigidBody = GetComponent <Rigidbody>(); m_RigidBody.constraints = RigidbodyConstraints.FreezePosition; Vector3 speakersPosition = m_PersonRequestingToBeSpokenWith.transform.position; Vector3 speakersDirection = m_PersonRequestingToBeSpokenWith.transform.forward; Quaternion speakersRotation = m_PersonRequestingToBeSpokenWith.transform.rotation; //adjust the below number to move player closer or farther from speaker Vector3 playerPlacement = speakersPosition + (speakersDirection * 1.75f); transform.position = playerPlacement; animator.SetFloat("Forward", 0.0f); animator.SetFloat("JumpLeg", 0.0f); //reset rotation before setting transform.rotation = Quaternion.identity; Vector3 relativePosition = m_PersonRequestingToBeSpokenWith.transform.position - transform.position; Quaternion rotation = Quaternion.LookRotation(relativePosition); transform.rotation = rotation; //freeze rotation or else hell float away m_RigidBody.constraints = RigidbodyConstraints.FreezeRotation; } else { //we are talking to a tome thirdPersonCam.RotateCamera(m_PersonRequestingToBeSpokenWith.transform); //dont set and just interact freely } }
IEnumerator WaitForCamera() { yield return(new WaitForSeconds(0.5f)); cameraChanger.FirstPersonCam = SheepCam; setCamera.RotateCamera(this.transform); }