// Set the transform that the camera will orbit around
        public void SetFollowCharacter(ExampleCharacterController character)
        {
            FollowCharacter        = character;
            PlanarDirection        = FollowCharacter.CameraFollowPoint.forward;
            _currentFollowPosition = FollowCharacter.CameraFollowPoint.position;

            // Ignore the character's collider(s) for camera obstruction checks
            _internalIgnoredColliders.Clear();
            _internalIgnoredColliders.AddRange(FollowCharacter.GetComponentsInChildren <Collider>());
        }
Example #2
0
        private void Start()
        {
            Cursor.lockState = CursorLockMode.Locked;

            // Tell camera to follow transform
            CharacterCamera.SetFollowTransform(Character.CameraFollowPoint);

            // Ignore the character's collider(s) for camera obstruction checks
            CharacterCamera.IgnoredColliders.Clear();
            CharacterCamera.IgnoredColliders.AddRange(Character.GetComponentsInChildren <Collider>());
        }