Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Will_Croxford · Jul 13, 2018 at 10:45 AM · charactercontrollerisgrounded

Charactercontroller.isGrounded never triggers

Hi, I'm just trying to implement basic jump ability on my 3D character, then realised, perhaps since beginning game, priestController.isGrounded is never triggering at all (I confirmed with print console command). Using Unity 2018.1.

This is still all in the Update() function at moment, not FixedUpdate(), but I assume that's not the issue. The movement and rotation of character all work fine, and they fall off things and fall back down to ground via gravity OK. It is standard CharacterController component, I have no rigidbody component on the character, do have Animator component on character in case relevant.

Radius of characterController is 0.7, Skin width of character controller I changed from 0.08 to 0.01, still isGrounded not triggering.

Other answers mention things about the order of the Move function related to checking .isGrounded, something about moving to not grounded state each frame, but not sure if and how this could help in my case. A thousand thanks for any suggestions.

 if (!hasRotationGravityFrozen)
             {
                 // is grounded is never triggered at all
                 if (priestController.isGrounded)
                 {
                     print("I'm grounded!");
                     gVelocity = Vector3.zero;
                     if (canJump && Input.GetKeyDown(KeyCode.Space))
                     {
                         gVelocity.y = 0.5f;
                         priestController.Move(gVelocity * Time.deltaTime);
                     }
                 }
                 else
                 {
                     // this is working fine
                     gVelocity.y += Gravity * Time.deltaTime;
                     priestController.Move(gVelocity * Time.deltaTime);
                 }
                 // this is working fine
                 if (this.transform.position.y <= -30 && !gravityKilled) {
                     gravityKilled = true;
                     Gravity *= 3;
                     GravityDeathSequence(); }
 
                 // and this is working fine
                 currentRotation.x += Input.GetAxis("Mouse X") * sensitivity;
                 currentRotation.y -= Input.GetAxis("Mouse Y") * sensitivity;
                 currentRotation.x = Mathf.Repeat(currentRotation.x, 360);
                 currentRotation.y = Mathf.Clamp(currentRotation.y, -maxYAngle, maxYAngle);
                 Camera.main.transform.rotation = Quaternion.Euler(currentRotation.y, currentRotation.x, 0);
             }
 
             if (!hasMoveFrozen)
             {
                 // and this is working fine
                 Vector3 forward = Camera.main.transform.forward;
                 Vector3 right = Camera.main.transform.right;
 
                 // The .normalized here scales the Vector to 1 unit size
                 Vector3 forwardDir = new Vector3(forward.x, 0, forward.z).normalized;
                 Vector3 rightDir = new Vector3(right.x, 0, right.z).normalized;
 
                 Vector3 move = (forwardDir * Input.GetAxis("Vertical")) + (rightDir * Input.GetAxis("Horizontal"));
                 priestController.Move(move * Time.deltaTime * Speed);
             }
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

98 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

bizarre collision modulations with character controller 1 Answer

controller.Move doesn't stay grounded when walking down slope 3 Answers

Problem with CharacterController.isgrounded 1 Answer

Animation through graphics in FPS controller, weird character controller issue, NEED help! 0 Answers

How do you make a characterController jump automatically when it reaches the edge of a platform? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges