- Home /
Why does children position offset on parent collision?
Unity 2019.1.11f1 Spent all day with this problem and am simply out of options. Parent is a RigidBody with capsule collider moved by force. Whenever parent starts grinding against a wall, empty game objects position gets offset. Any ideas why this is happening? Thanks.
Answer by Infenix · Feb 21, 2020 at 08:51 AM
If I'm understanding right what you're speaking about, whenever you move your parent object, children move the same in your world. If that's it, it is simply the normal behavior of objects in unity, and one of the main purposes of parent / children concept. If not, could you explain what is the problem more in depth and if possible provide an exemple?
The problem was children not moving the same. Example: parent is a humanoid, and child object is attached to its nose. When collision happened, let's say with a wall, child object would move changing its position from nose to ear or back of the head. And then stay there until another collision.
I just found the issue. Parent rigid body had X and Z axis frozen with angular drag set to 10, preventing it from rotating uncontrollably within Y axis on collision . Yet children changed their position. Freezing Y axis on parent rigid body has solved the issue for now. But if I'll ever need to unfreeze rotation this would still be a problem.
Your answer
Follow this Question
Related Questions
Weird Collisions Between Paddle and Ball (Breakout) 0 Answers
Unity3D: Get Velocity after collision 0 Answers
Destroy(other.gameObject) isn't destroying parent, only children 2 Answers
Sider Joint 2D in 3D 0 Answers
How to stop sphere from clipping through cube edges aside from lowering Time.FixedDeltaTime? 1 Answer