Previous thread for this: Zero-gravity Rigidbody with child collider gives strange behavior - Unity Engine - Unity Discussions
Hello, I am using the SteamVR asset to make my game.
Everything is going well at this juncture, except for one tiny little annoyance I’ve been putting up with this entire time.
My game relies on the player being in zero-G. For this, I simply have a rigidbody on the SteamVR rig and turned gravity off for it.
Great! However, to collide the player with the environment, I have the collision body on a child object (the head) of the rig.
Now, this works wonderfully well. Do not mistake that.
The problem is that the child collider is causing a constant, slowly worsening, random jitter in the rig’s position. I know this because disabling the collider causes the rig to stop jittering. The hands for the player have their own colliders as well, but they also have their own rigidbodies which I think prevents them from causing this behavior.
I have isolated the issue to motion of the child within local space of the rig (containing the rigidbody). By detaching the collider from the player’s head, and placing it on a stationary child object within the rig, there is NO jitter. As soon as I manually move this collider in Editor, during runtime, the rig begins to jitter.
So, I believe this is caused by the child collider moving in local space, and forcing the physics object to update, which doesn’t get the position quite right, and moves the whole rig ever so slightly. Since this is VR and the collider is attached to the player’s head, it is practically always moving in local space, thus producing this constant jitter. I also fear this might be causing unnecessary processing and will be a performance hindrence. ![]()
How can I fix this? It seems to be a bug from the physics engine. Very easy to replicate.
Is there a better way for me to set this up?
To clarify, I cannot put the collider on the parent object. It must follow the player’s head, and thus must move through local space. The rigidbody must be attached to the parent object, so that the entire rig moves when the player collides with something.
This is a huge annoyance, because the player is constantly jittering and cannot stop. After so much time has passed in-game, the jittering is so noticeable that it becomes a hindrance on gameplay itself. ![]()