# Discount get point inside mesh

**URL:** <https://forum.babylonjs.com/t/discount-get-point-inside-mesh/58604>\
**Category:** Tutorials and tips\
**Created:** [May 22, 2025, 9:29am UTC](https://forum.babylonjs.com/t/discount-get-point-inside-mesh/58604 "2025-05-22T09:29:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joe\_Kerr](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/joe_kerr/32/39017_2.png) [@Joe\_Kerr](https://forum.babylonjs.com/u/Joe_Kerr)\
**Post date:** [May 22, 2025, 9:29am UTC](https://forum.babylonjs.com/t/discount-get-point-inside-mesh/58604/1 "2025-05-22T09:29:59Z")

</div>

Hi everyone,

We already have [“Create Points Inside A Mesh”](https://doc.babylonjs.com/toolsAndResources/utilities/InnerMeshPoints/).

But this is quite heavy. In my use case I want to fire a couple of bullets against a box collider. All the bullets should collide but have a slightly deviated target vector. It just looks stupid if they all travel on the same trajectory.

Anyway, here is the discount version of the point-inside-mesh function: [Babylon.js Playground](https://playground.babylonjs.com/#FPLPD1)

Limitations: it samples in a sphere.

Best wishes  
Joe

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [May 22, 2025, 12:10pm UTC](https://forum.babylonjs.com/t/discount-get-point-inside-mesh/58604/2 "2025-05-22T12:10:34Z")

</div>

I did something a bit related for a side project using convex hull. It starts with a point inside or outside the volume. For each plane, keep it if one the inner side. if point is on the outter side, then project it onto that plane. It a convex hull so hole will not be taken into account.
