Unity VR Player Collision

Jordan T Kay
Apr 19, 2024

--

Thanks to the XR INTERACTION TOOLKIT we have the XR ORIGIN game object setup to allow the player to move and rotate. But, when the player moves, they do not collide with the environment and can walk right through things like a ghost! (I guess this works if your making a ghost game…)

To add collision detection to our player, we need to add the following components to our XR ORIGIN GameObject.

  1. Character Controller → Adds a capsule collider and physics logic to our player
  2. Character Controller Driver → taking in a Locomotion Provider (Can be obtained through Continuous Move Provider) the driver auto adjusts the Character Controller’s height property to adjust to the devices height from the floor.

--

--

Jordan T Kay

Join my journey into game development with Unity. Learning all I can to produce quality games. 🚀