# Spawn particles on a ground in a circle

**URL:** <https://forums.unrealengine.com/t/spawn-particles-on-a-ground-in-a-circle/350859>\
**Category:** FX\
**Tags:** particle-systems, unreal-engine, question, CPP\
**Created:** [March 17, 2016, 4:01pm UTC](https://forums.unrealengine.com/t/spawn-particles-on-a-ground-in-a-circle/350859 "2016-03-17T16:01:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![domzorg](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/domzorg/32/906605_2.png) [@domzorg](https://forums.unrealengine.com/u/domzorg)\
**Post date:** [March 17, 2016, 4:01pm UTC](https://forums.unrealengine.com/t/spawn-particles-on-a-ground-in-a-circle/350859/1 "2016-03-17T16:01:25Z")

</div>

I would like to spawn a particle system on the ground in a circle, for example.  
I took a fire from the content example.  
I can spawn a the particle system in C++, no problem.  
But now, I want to fill a circle on the ground. What is the best way to achieve that ? Since changing the box size of the particle system modify the apparence of the particle system.

Is it the best to spawn several particle systems on the ground to fill the space and therefore avoid modifying the particle system aspect ?

Txs for your suggestions.  
D.

---

<div class="post-metadata">

**Author:** ![domzorg](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/domzorg/32/906605_2.png) [@domzorg](https://forums.unrealengine.com/u/domzorg)\
**Post date:** [March 26, 2016, 11:13am UTC](https://forums.unrealengine.com/t/spawn-particles-on-a-ground-in-a-circle/350859/2 "2016-03-26T11:13:06Z")

</div>

I’ve implemented a solution that spawn several emitters in the circle.  
I keep them in an array to be able to destroy them when required.

---

<div class="post-metadata">

**Author:** ![Lourival](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lourival](https://forums.unrealengine.com/u/Lourival)\
**Post date:** [November 11, 2016, 8:38am UTC](https://forums.unrealengine.com/t/spawn-particles-on-a-ground-in-a-circle/350859/3 "2016-11-11T08:38:23Z")

</div>

Hey man, would you mind to share the code. I am not a programmer and I am trying to do something similar, so it would be of great help. Thank you.

---

<div class="post-metadata">

**Author:** ![domzorg](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/domzorg/32/906605_2.png) [@domzorg](https://forums.unrealengine.com/u/domzorg)\
**Post date:** [November 21, 2016, 5:44am UTC](https://forums.unrealengine.com/t/spawn-particles-on-a-ground-in-a-circle/350859/4 "2016-11-21T05:44:21Z")

</div>

This spell class is like a bullet or a rocket. When it touch the ground, I spawn the effect in a circle or ground actors, it depends on the spell configuration.

The OnImpact method is called with the HitResult as a parameter.  
TouchedGround() is called from the server in case you have a client/server game.  
WeaponConfig.Spell.SpellLife is the time for the spell. (effects or ground actors).  
WeaponConfig.Spell.DistanceGapInRadius defines the gap between effects or ground actors. If 0, then only one is spawned immediatly. If not, then the gap is used to fill the circle and effects or ground actors are spawned using a timer.  
For spell and ground actor, the algorithm is the same. Start from the center and spawn effects or actors using the gap. Keep the spawn objects within an array to be able to destroy then once the lifetime is reached.

For filling the circle it is very simple.

1. randomize the angle to avoid linear effect

2. NumPoints is calculated and used to known how many objects I have to spawn

3. DeltaPoints is used to spawn the number of objects during on call of the SpawnEffectActors()

4. Once the number of object is reached, calculate the new number of object to spawn during the next call of SpawnEffectActors()

5. Once the DistanceFromCenter is greather than the spell radius, stop the timer to stop spawning effects or ground actors

6. Finally, the function DisableAndDestroy is in charge of deactivating and destroying the effects kept within the array and the ground actor also

---

<div class="post-metadata">

**Author:** ![domzorg](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/domzorg/32/906605_2.png) [@domzorg](https://forums.unrealengine.com/u/domzorg)\
**Post date:** [December 1, 2016, 7:50am UTC](https://forums.unrealengine.com/t/spawn-particles-on-a-ground-in-a-circle/350859/5 "2016-12-01T07:50:07Z")

</div>

Was these explanations helpfull for you ?
