Stop Gun clipping into objects in Google VR (Cardboard) FPS game

Trying to stop clipping of my FPS gun into walls, for a VR game I’m making.

Traditional fixes seem to use multiple cameras, but I can’t use this method for a VR camera setup.

I tried using the super useful script at:
https://forum.unity3d.com/threads/drawing-order-of-meshes-and-sprites.212006/#post-2899026
as well as other similar scripted ways, to set the SortingLayer layer and sortingOrder on the gun mesh but these don’t seem to have any effect. Is this something special about the Gvr camera?

Are there any other workaround?

Many thanks

1 Like

Hi @baroquedub,

I had the same issue. I was able to get multiple camera solution working against clipping.
This was my setup:

GvrMain ->Head ->Main Camera

I added a second camera under the head, then applied the solution using culling mask you mentioned.
Also don’t forget to increase the depth of this second camera so it’ll draw on top of the main camera.