Fixing a Collision + Locomotion Bug

Tyler Smallwood
2 min readNov 24, 2023

--

Objective: Fix a bug while holding the grabbable.

Currently, if we are holding the basketball and trying to move the collider on the basketball is pushing our player back. To fixed this we had to create two new layers. We do this by selecting an object in the Hierarchy and click the drop down by Layer and select “Add Layer…”.

The Tags & Layers window will appear. Enter the names of the new layers you would like to add. I added XROrigin and Grab Interactables at Layers 6 and 7.

I selected the basketball and gave it the Grab Interactables Layer.

I then gave the XROrigin the XROrigin Layer.

To stop these from interacting with each other on the Physic’s layer we will go to Edit → Project Settings → Physics. At the bottom of the Physics page we will make sure that where Grab Interactables and XROrigin intersect is disabled. Doing this will tell the physics system to not allow these layer’s to interact.

With that we no longer have that bug. Thank you for reading!

--

--

Tyler Smallwood

I am passonate on learning to program and use Unity to become a skillful Unity Developer