Raycasting intersects objects which are present on front and back view

We are using raycasting to identify which mesh is interacted on click of 3d model. But this returns objects which present both front and back view.
Is there any way we can get only front view objects when model shows front view and when model rotates and if user clicks on back view only back view objects should be returned?

Raycast doesn’t have sense of front and back. You have a couple of options

  1. look at the normal of the intersect and decide if its front or back
  2. limit array of objects passed into raycast to only front facing objects

Can you share the details how to get front or back details using normal

Sorry I don’t remember the exact details. You can probably find answer with google search. Its something like multiply the normal against the camera’s normal. If it positive, its facing the camera. If its negative, its facing away. The operation could be dot product, I don’t remember.