protected virtual void UpdateCameraStates() { // CAMERA STATE - you can change the CameraState here, the bool means if you want lerp of not, make sure to use the same CameraState String that you named on TPCameraListData if (m_fpsCamera == null) { m_fpsCamera = FindObjectOfType <FirstPersonCamera>(); if (m_fpsCamera == null) { return; } if (m_fpsCamera) { //m_fpsCamera.SetMainTarget(this.transform); m_fpsCamera.Init(); } } }
private void Start() { cam = Camera.main; m_RigidBody = GetComponent <Rigidbody>(); foreach (CapsuleCollider c in GetComponents <CapsuleCollider>()) { if (!c.isTrigger) { m_Capsule = c; break; //make sure to get the right capsule collider } } m_inter = GetComponent <Interaction>(); m_anim = GetComponentInChildren <Animator>(); mouseLook.Init(this, cam); mouseLook2.Init(this, cam); world = GameObject.FindGameObjectWithTag("CONTROL").GetComponent <World>(); //get world script CAMERAPERSPECTIVE = 0; shellOffset = 0.1F; groundCheckDistance = 0.1F; posOld = gameObject.transform.position; //jumped = false; //jumpWait = 1.0f; itemsInReach = new List <GameObject>(); }