'VR hand Modules passthrough the UI canvas buttons

I am working on creating a demo of UI elements working in VR using leap motion hand module. I have implemented the Unity canvas UI button in world-space and right now I am able to click the button using the VR hand modules of leap motion, But while doing this I am facing an issue of hands passing though the UI canvas elements, Can anyone suggest me on how can I restrict the virtual hands going inside the UI when users is clicking the UI button?.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source