docs.unity3d.com
    Show / Hide Table of Contents

    Grounding customization

    Prevent grounding on hits

    You can use the IsGroundedOnHit callback of your character aspect to prevent grounding procedurally with code. For example, you could look at the presence of certain components on the hit entity, or look at the physics tags or categories of that object, and return false; in the function when you want the character to not be able to consider itself grounded on that hit.

    Constrain ground movement to the ground plane

    You can set the ConstrainVelocityToGroundPlane to true to make your character unable to "bump up into the air" when moving fast into slopes that are too steep to be grounded on:

    When set to false, your character won't attempt to constrain its velocity to the ground, and bumps up in the air:

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie 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.
    Generated by DocFX on 18 October 2023