Unity VR: Fixing a Collision & Locomotion Bug

3 min readApr 16, 2025

Intro

Our Right Hand Controller has a Direct Interactor, which allows your virtual hands (or controller models) to directly interact with nearby Grab Interactable Objects. But an issue can occur when the object Collider and XR Origin Collider intersect and you try to move…weird stuff can happen. The grabbed object tries to move based on the controller’s position, but then hits the XR Origin collider, causing conflicting physics responses.

The solution? Layer Collision Matrix!

Layer Collision Matrix

The Layer Collision Matrix is a settings panel that lets you control which layers can collide with each other in the physics engine.

Create a Layer

On any game object, click on Layer > Add Layer. This is where you give different physics layers a name. For this example, we want to put the XR Origin object and any Grab Interactable objects on there on layer, so we can name layers after them.

Once those layers have been created, make sure you assign those layers to their respective game objects.

Ignore Layers

Now we just need to tell the Physics engine to ignore those two layers when they interact using the Layer Collision Matrix. Go to Edit > Project Settings > Physics to find the Layer Collision Matrix.

The Collision Matrix is a big grid of checkboxes showing all possible layer-to-layer collision combinations.

Unchecked boxes mean objects on those two layers will not interact via collisions. So, that means the box that is shared with the XR Origin & Grab Interactables needs to be unchecked or turned off for those collisions to be ignored in the physics engine.

Conclusion

By setting up and customizing the Layer Collision Matrix, you can avoid frustrating physics issues caused by your XR Origin colliding with held objects. This simple step ensures smoother interactions and more natural movement in your VR experience — keeping your grabbable objects from bumping into the player and causing unpredictable behavior. It’s a small tweak that makes a big difference in polish and playability.

--

--

No responses yet