# Need some tips on spawning a random number of actors at a location

**URL:** <https://forums.unrealengine.com/t/need-some-tips-on-spawning-a-random-number-of-actors-at-a-location/126834>\
**Category:** Blueprint\
**Tags:** unreal-engine\
**Created:** [May 30, 2019, 2:31pm UTC](https://forums.unrealengine.com/t/need-some-tips-on-spawning-a-random-number-of-actors-at-a-location/126834 "2019-05-30T14:31:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_9545eedc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_9545eedc](https://forums.unrealengine.com/u/anonymous_user_9545eedc)\
**Post date:** [May 30, 2019, 2:31pm UTC](https://forums.unrealengine.com/t/need-some-tips-on-spawning-a-random-number-of-actors-at-a-location/126834/1 "2019-05-30T14:31:38Z")

</div>

I’ve created an actor for health, and an actor for ammo. They have a magnetic effect and travel to the player when the player overlaps the collision sphere. My next step is to spawn these two actors at the death location of my AI. The parameters are as follows.

1. I want to spawn both health and ammo each time an enemy is killed.
2. I want to cap the number of actors that are spawned to 0-4.
3. I want to select a random combination of these two actors that would equal the chosen number selected to spawn.

Any suggestions for nodes to look at or the math that might be involved? Any tips would be greatly appreciated. Thanks in advance guys and gals.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [May 30, 2019, 3:48pm UTC](https://forums.unrealengine.com/t/need-some-tips-on-spawning-a-random-number-of-actors-at-a-location/126834/2 "2019-05-30T15:48:54Z")

</div>

This should do it:

 ![Capture.PNG](https://d3kjluh73b9h9o.cloudfront.net/original/3X/e/b/eb9af48e5356b04c0e8efe103496a0dda8effacf.png)

Spawn health on T and ammo on F.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_9545eedc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_9545eedc](https://forums.unrealengine.com/u/anonymous_user_9545eedc)\
**Post date:** [June 1, 2019, 2:13pm UTC](https://forums.unrealengine.com/t/need-some-tips-on-spawning-a-random-number-of-actors-at-a-location/126834/3 "2019-06-01T14:13:42Z")

</div>

You rock dude. Thanks for the quick response. I will check this out and get to work.
