# How do you update GPUPick meshes list?

**URL:** <https://forum.babylonjs.com/t/how-do-you-update-gpupick-meshes-list/54769>\
**Category:** Questions\
**Created:** [November 14, 2024, 7:08pm UTC](https://forum.babylonjs.com/t/how-do-you-update-gpupick-meshes-list/54769 "2024-11-14T19:08:38Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![riven04](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/riven04/32/35407_2.png) [@riven04](https://forum.babylonjs.com/u/riven04)\
**Post date:** [November 14, 2024, 7:08pm UTC](https://forum.babylonjs.com/t/how-do-you-update-gpupick-meshes-list/54769/1 "2024-11-14T19:08:38Z")

</div>

Hi,

I can’t update the GPUPick meshes list, when I do so I get errors regarding instances, material or \_internalMeshDataInfo being undefined. The PG below creates a new sphere after 1 sec.

Playground: [Babylon.js Playground](https://playground.babylonjs.com/#YU2IJ5)

---

<div class="post-metadata">

**Author:** ![riven04](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/riven04/32/35407_2.png) [@riven04](https://forum.babylonjs.com/u/riven04)\
**Post date:** [November 14, 2024, 7:19pm UTC](https://forum.babylonjs.com/t/how-do-you-update-gpupick-meshes-list/54769/2 "2024-11-14T19:19:30Z")

</div>

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

Updated PG: using an array copy of scene.meshes based on:[Passing scene.meshes to GPUPicker.setPickingList will clear them when GPUPicker.dispose - #4 by kzhsw](https://forum.babylonjs.com/t/passing-scene-meshes-to-gpupicker-setpickinglist-will-clear-them-when-gpupicker-dispose/51658/4)

But still can’t update the list.

---

<div class="post-metadata">

**Author:** ![riven04](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/riven04/32/35407_2.png) [@riven04](https://forum.babylonjs.com/u/riven04)\
**Post date:** [November 14, 2024, 8:01pm UTC](https://forum.babylonjs.com/t/how-do-you-update-gpupick-meshes-list/54769/3 "2024-11-14T20:01:21Z")

</div>

The problem seems to be with scene.onNewMeshAddedObservable whenever the code for the GPUPicker is there it fails. How can I update the GPUGPicker list after a new mesh is created?

I tried checking with onReady() and setting the param to true as well, no luck

---

<div class="post-metadata">

**Author:** ![labris](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/labris/32/12576_2.png) [@labris](https://forum.babylonjs.com/u/labris)\
**Post date:** [November 14, 2024, 8:12pm UTC](https://forum.babylonjs.com/t/how-do-you-update-gpupick-meshes-list/54769/4 "2024-11-14T20:12:15Z")

</div>

> [@riven04](#):
>
> How can I update the GPUGPicker list after a new mesh is created?

Just give to the picker one frame to be ready after the observable is raised - [https://playground.babylonjs.com/#YU2IJ5#14](https://playground.babylonjs.com/#YU2IJ5#14)

---

<div class="post-metadata">

**Author:** ![riven04](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/riven04/32/35407_2.png) [@riven04](https://forum.babylonjs.com/u/riven04)\
**Post date:** [November 14, 2024, 8:16pm UTC](https://forum.babylonjs.com/t/how-do-you-update-gpupick-meshes-list/54769/5 "2024-11-14T20:16:11Z")

</div>

Thank you, this does it. Wish there was a more explicit way of doing this but it works

---

<div class="post-metadata">

**Author:** ![CodingCrusader](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/codingcrusader/32/29857_2.png) [@CodingCrusader](https://forum.babylonjs.com/u/CodingCrusader)\
**Post date:** [November 17, 2024, 8:08pm UTC](https://forum.babylonjs.com/t/how-do-you-update-gpupick-meshes-list/54769/6 "2024-11-17T20:08:17Z")

</div>

Perplexity: It seems that you are encountering a problem with the GPU Picker in Babylon.js. Based on the search results and the latest information from the Babylon.js forum, we should make some adjustments. Here is a revised approach:

[gpu picker](https://www.babylonjs-playground.com/#ON4AVO#1)

---

<div class="post-metadata">

**Author:** ![labris](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/labris/32/12576_2.png) [@labris](https://forum.babylonjs.com/u/labris)\
**Post date:** [November 18, 2024, 12:02am UTC](https://forum.babylonjs.com/t/how-do-you-update-gpupick-meshes-list/54769/7 "2024-11-18T00:02:48Z")

</div>

Example with one extra observer - [https://playground.babylonjs.com/#YU2IJ5#15](https://playground.babylonjs.com/#YU2IJ5#15)

---

<div class="post-metadata">

**Author:** ![CodingCrusader](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/codingcrusader/32/29857_2.png) [@CodingCrusader](https://forum.babylonjs.com/u/CodingCrusader)\
**Post date:** [November 20, 2024, 6:39pm UTC](https://forum.babylonjs.com/t/how-do-you-update-gpupick-meshes-list/54769/8 "2024-11-20T18:39:02Z")

</div>

Is there an attribute of gpuPicker that gives me back the point that was hit or do I have to use a ray?

[gpu picker | Babylon.js Playground](https://www.babylonjs-playground.com/#ON4AVO#3)

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/c/6/c68f80f4b7ee68d6bb0bfcaaa1bf71985a1ca511.png)

---

<div class="post-metadata">

**Author:** ![riven04](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/riven04/32/35407_2.png) [@riven04](https://forum.babylonjs.com/u/riven04)\
**Post date:** [November 20, 2024, 6:49pm UTC](https://forum.babylonjs.com/t/how-do-you-update-gpupick-meshes-list/54769/9 "2024-11-20T18:49:20Z")

</div>

Not yet, but there are some discussions with working PGs available: [Get Picked Position from GPU Pick Discussion](https://forum.babylonjs.com/t/get-picked-position-from-gpu-pick-discussion/54815)

Also this one: [GPU picking point and normal example - #35 by xiehangyun](https://forum.babylonjs.com/t/gpu-picking-point-and-normal-example/40965/35)
