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; }
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; }