Rigidbody / Animator Moving Y Position - bug?
The Y position on my model is moving down. When I go in the object's inspector, this can be stopped 1 of 2 ways.
Disabling the animator
Removing the rigidbody component
I need both. Why would the transform.position.y continuously move downward? Is this a known bug?
Things I've checked:
Turned off all other objects and scripts
Froze the y position of the rigidbody (kinematic stops the movement, but I am applying root motion so I need kinematic off)
Cycled through all rigidbody and animation drop down options
Checked my fbx's animation files, and there are no y position changes to its root motion. This issue is consistent regardless of which animation is playing.
Used different colliders
and a lot of other things. Honestly, it seems like a bug, but I have a creeping suspicion its got something to do with my fbx from blender. But why wouldn't that play nice with the rigid body component? it goes down by like 0.0001 per frame, so eventually the character moves noticeably below where they should.
Any ideas or help is much appreciated.
Answer by Tekksin · Feb 20, 2019 at 05:17 AM
Ok, solved.
___So for some reason I had some colliders attached to bones, which were a child of the parent which had this rigidbody and capsule collider on it.
___The children, animating along with the bones of the animation in unity, were rubbing up against the parent collider and causing it to slowly sink and move to the side by unbelievably small amounts, which were only noticeable after a few minutes when the toes went through the floor.
___These colliders were used for the cloth physics on some objects, but cloth collisions don't need to be on in the inspector (probably for this reason?)... so instead of making them all triggers, which I think would still work, I just searched all the body collision objects and turned them off. Now the character no longer very slowly moves around by its parent, and it has nothing to do with the rigidbody (because it's no longer rubbing up against other active colliders), and it has nothing to do with the animator (because the colliders wouldn't rub against eachother on a non-moving character).
___Alternatively, if you have to have your colliders on for whatever reason, you can always change the physics layer of the colliders so they never interact. For me, I just had to turn them off. I doubt this will help a lot of people, but maybe in someone else's brainstorming with tiny random glitches (where they would never conceive the parent would have its position moved by a child component) they will find this discovery useful.
Your answer
Follow this Question
Related Questions
AvatarBuilder.BuildHumanAvatar set NaN positions with some avatars 1 Answer
inspector GUI in animator bugged when trying to add behaviour 2 Answers
[Probably Bug] Objects with colliders falling trough ground 1 Answer
Particle System not showing anything in its Component separated editor? 0 Answers
Can't add condition to a transition in animator controller 0 Answers