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

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.

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.

Remap Properties

Then, transfer the new attribute to density.