- Home /
"GravityWeight" curve in animator is not affecting the rigidbody's gravity?
I'm following Unity's Mechanim tutorial and have ran into a trouble where the "GravityWeight" curve set up as shown in https://www.youtube.com/watch?v=Xx21y9eJq1U at 31:13, is not affecting my character's gravity.
What ends up happening in the scene is: the character jumps, the collider height is reduced but gravity is not affected, and as a result the character will sink into the ground because the collider was shortened for a moment.
Here is the set up for the jumping animation that I'm using in my scene. Note that I'm not using any scripts to access the "GravityWeight" curve because according to the video its internal or something.
I've also checked other people's posts on the same problem, but after trying some stuff that they suggested the problem is still here. http://answers.unity3d.com/questions/500754/gravityweight-for-mecanim-jump-animation-following.html http://forum.unity3d.com/threads/mecanim-and-gravityweight.162233/
Hi I'm still struggling and trying to find the problem. https://www.dropbox.com/s/jcwhmlzra1lvsnp/ProblemPackage.unitypackage?dl=0 Here is a 3mb Unity package containing the assets I'm working with, if anyone wouldn't $$anonymous$$d taking a look for me?
Basically, when you press SpaceBar to jump, the capsule collider is shrunk/shortened vertically and sinks into the ground, but I want its gravity to be affected by the gravityWeight curve just like in the $$anonymous$$echanim tutorial :(
Answer by Arkade · Jun 30, 2017 at 07:27 PM
(realise this is quite old but since it was the first hit when I searched and it gave me a clue to the answer, here's the answer...)
"gravityWeight" not "GravityWeight" -- it's case sensitive.
I just read the exact opposite. That its GravityWeight NOT gravityWeight... oh boy.
EDIT: Just confirmed this works for me with "GravityWeight" in 2018.4.13f1
Also if you use blendtrees, see my post here:
https://forum.unity.com/threads/animator-gravity-weight.651985/
Your answer
![](https://koobas.hobune.stream/wayback/20220613161903im_/https://answers.unity.com/themes/thub/images/avi.jpg)