# Spawn particles in circle

Hi, currently studying how to create vfx in vfx graph and haver a question about declaring position of particles
I have a position in shape of circle, but the question is how to spawn particles along the arc not randomly, but with declared step, for example 0.05.
And the second question is how to rotate each particle depending of position of arc where it spawned

Hello.

So regarding the â€śCircle Positionâ€ť with declared steps you have several way of doing it.
The easiest way might be to use a â€śSet Position: Sequential Circleâ€ť instead of the â€śArc Circleâ€ť.
This Block Allow you to use the â€śParticleIDâ€ť to â€śloopâ€ť over the Circle Position.
Set itâ€™s Mode to â€śWrapâ€ť and your Count to desired value (it will be the your number of Steps) and donâ€™t forget to balance your Particle Count with the desired â€śStepsâ€ť :

The other way would be to use the Regular â€śSet position : Arc Sphereâ€ť Block taht you already use and set itâ€™s â€śSpawnModeâ€ť to â€śCustomâ€ť.
Youâ€™ll then have access to the â€śArc Sequencerâ€ť, a 0-1 pin input that control the position on the circle.
Youâ€™ll have to provide a 0-1 value in â€śstepsâ€ť. Here are some ideas:

The â€śparticleIDâ€ť attribute Modulo (%) the Number of desired Steps will giving you a â€ścyclingâ€ť integer value between
0 and the desired numberSteps.
In my example ParticleID % 20 will give us a int Value between 0-19.
We then divide this value by the Desired Steps and this would give use a 0-1 value to use for or â€śArc Sequencerâ€ť.

Another method could be to generate a â€śRandom Numberâ€ť Between 0- NumberSteps, Floor it to get rid of decimal part, and divide it by the Number of Steps. This will also give you a 0-1 â€śstepped valueâ€ť usable in the â€śArc Sequencerâ€ť.
But as the itâ€™s a random generation, sometime some Spot might not be filled by a particle.
It really depend on your end Goal.

1 Like

Regarding the â€śRotation Questionâ€ť it really depends on what you really want to achieve.
You could take a â€śPositionâ€ť based approach were you directly set the â€śParticle Positionâ€ť. For this the â€śRotate2Dâ€ť or â€śRotate3dâ€ť block operator will be your best friends:
Hereâ€™s a small ScreenShot using â€śRotate2Dâ€ť if you only need a â€śsimpleâ€ť 2Drotation.

But donâ€™t hesitate to look at this thread for more in-depth info as itâ€™s quite similar to what youâ€™re asking.

A different approach can be taken by setting the â€śVelocityâ€ť of our particles instead of the â€śPositionâ€ť. This approach is more â€śphysicalâ€ť so youâ€™ll be able to add Turbulence, Drag an other Forces.
The Downside is that itâ€™s less â€śArt directableâ€ť and can be harder to control.
But here are some ideas:

You need Velocity vector that rotate around your â€śCircle Front Axisâ€ť. While thereâ€™re many ways to achieve this , here are two of them:

Cross Product:
A cross product between two vectors, is an operation that will return another Vector perpendicular two both the input Vectors. With this in Mind:

Another Method would be to Swap-Inverted Vector Components.
The ParticlePosition on a (0,0,0) centered Circle can be used as the â€śNormalâ€ť of this circle.
So we can swap two component of our vector to Obtain another Vector.
From there Inverting the Axes Should give us a result pretty similar to our Cross-Product.

And here are Some Vector To help you visualize the Swapping operation and the the â€śXâ€ť Inversion.

1 Like

Thanks a lot, really appreciate your detailed response, it really helped me.