diff --git a/Assets/Scripts/StudyCase2/ThirdCharacterController.cs b/Assets/Scripts/StudyCase2/ThirdCharacterController.cs index c0fc07b..8234109 100644 --- a/Assets/Scripts/StudyCase2/ThirdCharacterController.cs +++ b/Assets/Scripts/StudyCase2/ThirdCharacterController.cs @@ -38,11 +38,11 @@ namespace StudyCase2 moveDir = forward.TransformDirection(moveDir); if (moveInput != Vector2.zero) { - animator?.SetBool("Move", true); + animator.SetBool("Move", true); Quaternion target = Quaternion.LookRotation(new Vector3(moveDir.x, 0, moveDir.z)); model.rotation = Quaternion.Slerp(model.rotation, target, turnSpeed * Time.deltaTime); } - else animator?.SetBool("Move", false); + else animator.SetBool("Move", false); if (!characterController.isGrounded) moveDir.y -= gravity * Time.deltaTime; characterController.Move(moveDir * moveSpeed * Time.deltaTime); diff --git a/Assets/Scripts/StudyCase3/ThirdCharacterController.cs b/Assets/Scripts/StudyCase3/ThirdCharacterController.cs index 733e367..8f4e64e 100644 --- a/Assets/Scripts/StudyCase3/ThirdCharacterController.cs +++ b/Assets/Scripts/StudyCase3/ThirdCharacterController.cs @@ -82,11 +82,11 @@ namespace StudyCase3 moveDir = forward.TransformDirection(moveDir); if (moveInput != Vector2.zero) { - animator?.SetBool("Move", true); + animator.SetBool("Move", true); Quaternion target = Quaternion.LookRotation(new Vector3(moveDir.x, 0, moveDir.z)); model.rotation = Quaternion.Slerp(model.rotation, target, turnSpeed * Time.deltaTime); } - else animator?.SetBool("Move", false); + else animator.SetBool("Move", false); if (!characterController.isGrounded) moveDir.y -= gravity * Time.deltaTime; characterController.Move(moveDir * moveSpeed * Time.deltaTime);