unity-game-enginevirtual-realitysteamhtc-vive

Need to stop SteamVR camera seeing through walls


I am using player prefab from SteamVR Plugin. Whenever player touches an object with a Collider on it, camera sees through it. I am using 0.01 as minimum clipping value. I have also added Rigidbody and Collider on camera.


Solution

  • I also do not have code currently but here’s a concept of how to approach the problem:

    1. Keep a trigger collider on the camera.
    2. Write a script that detects when that collider is within another collider (your walls). There is a method for checking if colliders are intersecting/overlapping
    3. If there is an intersect/overlap, fade the camera to black. If there is not, fade back.