# CullBackFaces not working on ray picked mesh?

**URL:** <https://forum.babylonjs.com/t/cullbackfaces-not-working-on-ray-picked-mesh/39382>\
**Category:** Questions\
**Created:** [March 27, 2023, 2:49pm UTC](https://forum.babylonjs.com/t/cullbackfaces-not-working-on-ray-picked-mesh/39382 "2023-03-27T14:49:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pryme8](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pryme8/32/7212_2.png) [@Pryme8](https://forum.babylonjs.com/u/Pryme8)\
**Post date:** [March 27, 2023, 2:49pm UTC](https://forum.babylonjs.com/t/cullbackfaces-not-working-on-ray-picked-mesh/39382/1 "2023-03-27T14:49:29Z")

</div>

So I was going to help with:

> [@How to make a ray casted detect only the back face of cube?](https://forum.babylonjs.com/t/how-to-make-a-ray-casted-detect-only-the-back-face-of-cube/39381):
>
> In my scene, I have a cube with the sideOrientation option set to mesh.BACKSIDE when I cast a ray it picks the point from the front side of the cube if the ray intersects the front side. How to make the ray only detect the backside?

When I started to make my response I noticed that if you reference a ray picked meshes material and then try to set the cullBackFaces it says that that property does not exist, yet when you console log out the material and can see the property in the objects context…

The plot thickens even more that you can console log out the specific material that the pick is supposedly referencing (the actual declared reference not the pick reference) and the cullBackFaces is there no problem…

This is really funky behavior.

See lines 67,68

> **[Babylon.js Playground](https://playground.babylonjs.com/#KNE0O%232087)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [March 27, 2023, 4:55pm UTC](https://forum.babylonjs.com/t/cullbackfaces-not-working-on-ray-picked-mesh/39382/2 "2023-03-27T16:55:10Z")

</div>

You are picking the ground which does not have material

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/2/8/28d70c6fa3aa26ec02f6a4a53c611c6154bf326a.png)

---

<div class="post-metadata">

**Author:** ![Pryme8](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pryme8/32/7212_2.png) [@Pryme8](https://forum.babylonjs.com/u/Pryme8)\
**Post date:** [March 27, 2023, 7:55pm UTC](https://forum.babylonjs.com/t/cullbackfaces-not-working-on-ray-picked-mesh/39382/3 "2023-03-27T19:55:28Z")

</div>

Ha, XD Im dumb…

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [March 27, 2023, 8:44pm UTC](https://forum.babylonjs.com/t/cullbackfaces-not-working-on-ray-picked-mesh/39382/4 "2023-03-27T20:44:10Z")

</div>

nah, this happens to me all the time 🙂 more pair of eyes usually help
