User collision and grabbable objects

I’m new to VR and trying to implement body collision with the environment. I set up a XR Rig with a Snap Turn Provider and a Continuous Move Provider, both action-based.


I then added a rigidbody and a capsule collider to the rig so I can’t clip through walls, and worked.

The problem is when I try to grab an object, it pulls me away

The objects have these properties


How can I prevent this from happening? I’m new to VR and Unity.

I’ve been having this same problem. Did you ever find a solution?

Hi @PauliiNGrund

Thanks for posting this issue and sharing the screenshots. I was able to reproduce the problem in the demo scene WorldInteractionDemo from our VR example project. It turned out to be the result of the XRGrabInteractable’s collider hitting the Character Controller (a capsule collider) that we set up on the rig to handle movement under collision constraints without using a Rigidbody. Your setup is basically the same. So if you grab the interactable and move it close to the body, the two colliders will overlap (you may notice the collider Gizmos in your Scene view when this happens) and the object will block your character from continuous movement.

One solution that I tested is to use Physics.IgnoreCollision to ignore the collision between the XRGrabInteractable’s collider(s) and the capsule collider/Character Controller. So I tried adding the following code in the Grab() method of XRGrabInteractable, and the problem got resolved.

            var characterController = FindObjectOfType<CharacterController>();
            if (characterController != null)
            {
                foreach (var collider in colliders)
                {
                    Physics.IgnoreCollision(collider, characterController, true);
                }
            }

You may want to implement something like this in your own gameplay code or override XRGrabInteractable to handle disabling and re-enabling the collision between your character’s collider and the object’s collider(s), for example, in its Grab() andDetach() methods.

The problem and the Physics.IngoreCollision solution were also posted in another post by @unity_J2-PAmxzfzl9Dw . We will consider in the future providing a generic solution if we find this continues to be a common user pain point.