- Home /
Rigidbody Freeze Contraints Not Working
Hey everyone,
I have a simple object with a Rigidbody that has it's Y position frozen. I don't want any movement on the Y axis whatsoever.
The freeze works fine when there are no physics interactions... However, when the object collides with another physics object, it's Y position begins changing (very slightly, only tenths of a unit per second). If it's not frozen, the Y position changes much more rapidly, so the freeze is doing something, just not enough. I can't figure out why this is occuring.
I have no scripted collision interactions at the moment, so it's only the physics system acting on it.
Do I need to manually set the Y position to 0 constantly in a script? That feels... odd to me, especially since the constraints are there for this specific purpose.
I'm having the exact same issue, and I've noticed the problem only exists when I have a collider on the object (whether mesh, or box collider). Enable the collider, and the object will slowly fall downwards.
Just in case I've also disabled gravity on the rigidbody, as well as setting Gravity to zero (set it to 0m/s in Physics settings).
I realize your post is from a couple of years ago, with no responses, so I'm skeptical this comment will help much but hey it doesn't hurt to try, right?
Answer by belamessex · Jan 11, 2016 at 06:27 AM
@nrXic I think I figured it out. I'm using a sphere collider, but I had the center of the collider slightly off at 0,-.5,0 (you can change the collider's center in the component menu) . I changed it to 0,0,0 and problem solved. Freezing position takes place in local space, not world space, so I believe it has to do with a skewed rotation or collision force based on the collider center, that causes the Rigidbody to interpret it's local space in a weird way.
Hope that helps.
Answer by Nadir_Alishly · Aug 28, 2020 at 07:05 AM
I had a same issue when freeze position and rotation not worked as they supposed to. I had two (box) colliders on my object, but one of them was under Rigidbody component. When moved collider up everything started to behave normally. Don't think that it will solve every issue, but it worked for me.
Your answer
Follow this Question
Related Questions
holding position 1 Answer
Unfreeze Rigidbody ROTATION only 1 Answer
Making something move relative to something else, but slower/shorter ? 2 Answers
Remove rigidbody component 1 Answer
Freeze Position problem 1 Answer