void Start() {
			animator = GetComponent<Animator> ();
			fixFeet = gameObject.AddComponent<FixFeet>();
			
			animator.SetBool ("IsStrafing", true);
			playerLastPosition = characterController.position;
			
			cameraPivot = new GameObject().transform;
			cameraPivot.name = "Camera Pivot";
			cameraPivot.position = characterController.position + characterController.rotation * cameraOffset;
			cameraPivot.rotation = characterController.rotation;
			cameraPivot.parent = characterController;
			cam.parent = cameraPivot;
		}
Beispiel #2
0
        void Start()
        {
            animator = GetComponent <Animator> ();
            fixFeet  = gameObject.AddComponent <FixFeet>();

            animator.SetBool("IsStrafing", true);
            playerLastPosition = characterController.position;

            cameraPivot          = new GameObject().transform;
            cameraPivot.name     = "Camera Pivot";
            cameraPivot.position = characterController.position + characterController.rotation * cameraOffset;
            cameraPivot.rotation = characterController.rotation;
            cameraPivot.parent   = characterController;
            cam.parent           = cameraPivot;
        }