# PCG: How to spawn actors inside a volume and change the density along the Z axis.

**URL:** <https://forums.unrealengine.com/t/pcg-how-to-spawn-actors-inside-a-volume-and-change-the-density-along-the-z-axis/2656927>\
**Category:** World Creation\
**Tags:** Procedural-Generation, unreal-engine, procedural, question\
**Created:** [September 15, 2025, 8:04pm UTC](https://forums.unrealengine.com/t/pcg-how-to-spawn-actors-inside-a-volume-and-change-the-density-along-the-z-axis/2656927 "2025-09-15T20:04:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Babush61](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Babush61](https://forums.unrealengine.com/u/Babush61)\
**Post date:** [September 15, 2025, 8:04pm UTC](https://forums.unrealengine.com/t/pcg-how-to-spawn-actors-inside-a-volume-and-change-the-density-along-the-z-axis/2656927/1 "2025-09-15T20:04:06Z")

</div>

Hello.  
Question 1: Can anyone show me how to spawn actors inside a volume so that there are more objects at the top than at the bottom of the volume?

Question 2: How to change the density along the Z-axis inside a volume. I can find the “Distance” nodes and others, but I don’t understand how to use them.

---

<div class="post-metadata">

**Author:** ![Babush61](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Babush61](https://forums.unrealengine.com/u/Babush61)\
**Post date:** [September 17, 2025, 6:48pm UTC](https://forums.unrealengine.com/t/pcg-how-to-spawn-actors-inside-a-volume-and-change-the-density-along-the-z-axis/2656927/2 "2025-09-17T18:48:02Z")

</div>

I found a solution for interpolating density along the Z-axis.  
After Volume Sampler, you need to take the Position.Z attribute and call Remap.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/e/9/6e9c057ca0b666fff856923fa7e173fd832f54ec.png)

Remap Properties

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/f/c/2fc2e0d3aba23ffdf11002f987a531322bf3352a.png)

Then, transfer the new attribute to density.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/5/d/35d30f87be2d932ff0e8595c20cd7dab7396f52b.png)
