# Generate random points on a static mesh

**URL:** <https://forums.unrealengine.com/t/generate-random-points-on-a-static-mesh/1409070>\
**Category:** Blueprint\
**Tags:** unreal-engine, question\
**Created:** [November 21, 2023, 12:56pm UTC](https://forums.unrealengine.com/t/generate-random-points-on-a-static-mesh/1409070 "2023-11-21T12:56:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Astro-Chris](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/astro-chris/32/547152_2.png) [@Astro-Chris](https://forums.unrealengine.com/u/Astro-Chris)\
**Post date:** [November 21, 2023, 12:56pm UTC](https://forums.unrealengine.com/t/generate-random-points-on-a-static-mesh/1409070/1 "2023-11-21T12:56:07Z")

</div>

Is there a way of generating random points on the surface of a static mesh that items can be attached to? For example, points on a statue to which butterflies will settle and cover said statue? Using vertices perhaps? I’m hoping to use blueprints for this. Thanks in advance.

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [November 21, 2023, 2:16pm UTC](https://forums.unrealengine.com/t/generate-random-points-on-a-static-mesh/1409070/2 "2023-11-21T14:16:08Z")

</div>

Yes. You can use line traces from outside the object, heading inwards. Put the butterflies at the intersection point ( you will need complex collision on for the mesh ).

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/c/1/0c15fae9f5ac55b76017f990746014306453035b.png)

![On object](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/f/3/0f3049d4400f3e1b2011d87cfb778d977ebea0b2.gif)

You can also do this with PCG, of course. Then you can target the vertex data of the mesh…

---

<div class="post-metadata">

**Author:** ![Astro-Chris](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/astro-chris/32/547152_2.png) [@Astro-Chris](https://forums.unrealengine.com/u/Astro-Chris)\
**Post date:** [November 22, 2023, 1:36am UTC](https://forums.unrealengine.com/t/generate-random-points-on-a-static-mesh/1409070/3 "2023-11-22T01:36:16Z")

</div>

That’s really useful, thank you. I knew PCG might be an option, but line tracing never occurred to me for some reason. I will investigate further.

---

<div class="post-metadata">

**Author:** ![SupportiveEntity](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SupportiveEntity](https://forums.unrealengine.com/u/SupportiveEntity)\
**Post date:** [November 22, 2023, 6:17am UTC](https://forums.unrealengine.com/t/generate-random-points-on-a-static-mesh/1409070/4 "2023-11-22T06:17:07Z")

</div>

Hey there @Astro-Chris! Clockwork’s setup is great! An alternative if you wanted to use vertices for any reason, you can use Rama’s Victory Plugin to get the SM vertex locations regardless of scale. I use this for finding verts and iterating on them at runtime myself.

> [@Rama's Extra Blueprint Nodes for UE5, No C++ Required!](https://forums.unrealengine.com/t/victory-plugin-s-extra-blueprint-nodes-for-ue5-no-c-required/231476):
>
> zap Victory Plugin For UE5 [You Can Easily Create Save Game Images With Victory Plugin for UE5!](https://forums.unrealengine.com/t/victory-plugin-ramas-extra-blueprint-nodes-for-ue5-no-c-required/231476/6) Dear Community, I am making my Victory Plugin for UE5! Please let me know which VictoryPlugin nodes you want most from the UE4 version and I can work on bringing them into UE5! ~ \*\* Community Bonus\*\*: [Easy Way to Activate Your Pineal Gland For Cleaner Coding / Faster Development Cycle](https://forums.unrealengine.com/t/victory-plugin-ramas-extra-blueprint-nodes-for-ue5-no-c-required/231476/48)~ zapzapzapzapzapzapzapzapzapzapzapzapzapzapzapzapzapzap…

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [December 22, 2023, 6:17am UTC](https://forums.unrealengine.com/t/generate-random-points-on-a-static-mesh/1409070/5 "2023-12-22T06:17:37Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
