# Only the last wall in the array is hidden

**URL:** <https://forum.babylonjs.com/t/only-the-last-wall-in-the-array-is-hidden/54156>\
**Category:** Questions\
**Tags:** camera\
**Created:** [October 16, 2024, 12:11pm UTC](https://forum.babylonjs.com/t/only-the-last-wall-in-the-array-is-hidden/54156 "2024-10-16T12:11:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fcozsargin](https://avatars.discourse-cdn.com/v4/letter/f/82dd89/32.png) [@fcozsargin](https://forum.babylonjs.com/u/fcozsargin)\
**Post date:** [October 16, 2024, 12:11pm UTC](https://forum.babylonjs.com/t/only-the-last-wall-in-the-array-is-hidden/54156/1 "2024-10-16T12:11:06Z")

</div>

hello everyone. I want to hide the wall that collides with the camera’s raycast and show the others. However, only one wall is hidden and shown. Where might the problem be? can you help?

> **[Babylon.js Playground](https://playground.babylonjs.com/#4GBWI5%232330)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL and WebGPU 3D scenes

---

<div class="post-metadata">

**Author:** ![Tricotou](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/tricotou/32/5844_2.png) [@Tricotou](https://forum.babylonjs.com/u/Tricotou)\
**Post date:** [October 16, 2024, 12:21pm UTC](https://forum.babylonjs.com/t/only-the-last-wall-in-the-array-is-hidden/54156/2 "2024-10-16T12:21:00Z")

</div>

Hello,

Regardless of your hide procedure, there is something strange with your node/mesh structure. If you comment line 685 (hidding procedure), then deleting all from 1 to 7 has no effect :

 ![Screenshot from 2024-10-16 14-19-19](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/a/d/adc477cf7f6b2f0f44974d2bc36de4404600fac2.png)

---

<div class="post-metadata">

**Author:** ![mawa](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mawa/32/12384_2.png) [@mawa](https://forum.babylonjs.com/u/mawa)\
**Post date:** [October 16, 2024, 2:14pm UTC](https://forum.babylonjs.com/t/only-the-last-wall-in-the-array-is-hidden/54156/3 "2024-10-16T14:14:08Z")

</div>

Indeed. Everything has been merged to ‘wall\_8’ using substract or else (didn’t check the script).  
Anyways there’s only one wall object left (wall\_8) and besides, the function of hide says that if it includes(“wall”) it should… whatever… well, they all include ‘wall’ in the name, so what do you expect to happen?

---

<div class="post-metadata">

**Author:** ![fcozsargin](https://avatars.discourse-cdn.com/v4/letter/f/82dd89/32.png) [@fcozsargin](https://forum.babylonjs.com/u/fcozsargin)\
**Post date:** [October 16, 2024, 2:18pm UTC](https://forum.babylonjs.com/t/only-the-last-wall-in-the-array-is-hidden/54156/4 "2024-10-16T14:18:18Z")

</div>

Thanks, I didn’t notice this before. Now when I reset the normal indexes and uvs data for each location at the end of the loop the problem is solved.
