Hey everyone!
I’ve been working on a game world for VRC, but just hit a really confusing problem. I was following the documentation here on layers: Unity Layers in VRChat | VRChat Creation .
I created 3 new layers for my world, on layers 23-25. Enemies, Floor, PlayerItems
I’m using a raycast on specific layers, using LayerMask.GetMask
if (Physics.Raycast(spawnPointTransform.position, spawnPointTransform.TransformDirection(Vector3.up), out var hit,
maxDistance: MAX_DISTANCE, layerMask:LayerMask.GetMask("Floor", "Enemies", "Environment")))
And this works perfectly in editor. But when I do a “Build & Test”, objects in my new layers don’t get returned from the raycast. It hits anything in the ‘Environment’ layer though. So… what the heck? It’s causing a ton of game-breaking bugs. :(
Any help would be very much appreciated.