In my model I have using raycast to calculate the thickness of the cube. I want to know is it possible to disable raycast when the object is invisible, for example in my model the box3 is invisible and it is right side of the violet box.
Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true
Added two different picks to your double click thing so you can see how to do it. Id recommend going with the scene.pick one instead of the pick with ray. Unless its like a gun or something then do a pick with ray using the camera.getForwardRay(range)