camera culling mask Layers

Hello

I am trying to switch the main camera culling mask

depending on what you collide with…

This is the script on the box:

Almost works… but not

using UnityEngine;
using System.Collections;

public class boxCollision : MonoBehaviour
{

    public bool boxToggle = false;
    public int cullMask = 11;

    void Update()
    {
        //Transform thisTransform = this.gameObject.transform;
        //UpdateVRCameraTransform(thisTransform);

        //TOGGLE CULLING MASK
        if (boxToggle == false)
        {
            Camera.main.cullingMask = 1 << cullMaskTHREAD;
            //   ;
        }
        else { Camera.main.cullingMask = 1 << cullMask; }
    }

    void OnCollisionEnter(Collision collision)
    {
        boxToggle = true;
       Camera.main.cullingMask = 1 << cullMask;

    }
}

Thanks!

~be

“but not” isn’t a very good description so I don’t know what’s happening here; try this link to make working with layermasks easier (Scroll down)