# Is there any way to get the vertex index of a particular piece of terrain when clicking on it

**URL:** <https://forum.babylonjs.com/t/is-there-any-way-to-get-the-vertex-index-of-a-particular-piece-of-terrain-when-clicking-on-it/53060>\
**Category:** Questions\
**Tags:** vertex\
**Created:** [August 28, 2024, 10:02am UTC](https://forum.babylonjs.com/t/is-there-any-way-to-get-the-vertex-index-of-a-particular-piece-of-terrain-when-clicking-on-it/53060 "2024-08-28T10:02:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kitty](https://avatars.discourse-cdn.com/v4/letter/k/278dde/32.png) [@Kitty](https://forum.babylonjs.com/u/Kitty)\
**Post date:** [August 28, 2024, 10:02am UTC](https://forum.babylonjs.com/t/is-there-any-way-to-get-the-vertex-index-of-a-particular-piece-of-terrain-when-clicking-on-it/53060/1 "2024-08-28T10:02:52Z")

</div>

- I want to say is  
When I click on an area of the terrain, I only get the index and position of the vertex I clicked on

---

<div class="post-metadata">

**Author:** ![Kitty](https://avatars.discourse-cdn.com/v4/letter/k/278dde/32.png) [@Kitty](https://forum.babylonjs.com/u/Kitty)\
**Post date:** [August 28, 2024, 10:04am UTC](https://forum.babylonjs.com/t/is-there-any-way-to-get-the-vertex-index-of-a-particular-piece-of-terrain-when-clicking-on-it/53060/2 "2024-08-28T10:04:36Z")

</div>

This terrain is a Mesh in which the vertices of the click position are extracted

---

<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:** [August 28, 2024, 10:21am UTC](https://forum.babylonjs.com/t/is-there-any-way-to-get-the-vertex-index-of-a-particular-piece-of-terrain-when-clicking-on-it/53060/3 "2024-08-28T10:21:37Z")

</div>

What do you mean by “a particular piece of terrain”?

---

<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:** [August 28, 2024, 2:34pm UTC](https://forum.babylonjs.com/t/is-there-any-way-to-get-the-vertex-index-of-a-particular-piece-of-terrain-when-clicking-on-it/53060/4 "2024-08-28T14:34:59Z")

</div>

@Kitty you will mostly never click on a vertex but in between 3 vertices creating a face.

if you follow the doc [https://doc.babylonjs.com/features/featuresDeepDive/mesh/interactions/picking\_collisions](https://doc.babylonjs.com/features/featuresDeepDive/mesh/interactions/picking_collisions) you ll learn how to get picking infos which contains the face id you are looking for.

As a usage example, here is how we use it to extract interpolated UVs from a picked coordinate:

> <https://github.com/BabylonJS/Babylon.js/blob/master/packages/dev/core/src/Collisions/pickingInfo.ts#L168>
