Hello community!
I have a question regarding spawning actors and hope you guys can help me out.
I’ve been trying to get this to work for 2 weeks now and been looking in all forums for an answer, but no luck!..
Some forum posts that I have found came close to what I want to achieve but again… nothing.
My game mechanic: Open drawers, cabinets, stash boxes etc and find a random item inside.
My issue: I’d like to push it further and have the spawner… spawn a controlled number of random items and having those items random each playthrough.
Example: there are over 30 drawers in my scene and I have 4 different type of items (sphere, cone, cube and rectangle) and ON PLAY I’d like 1 sphere to spawn in the scene inside a drawer, 3 cones to spawn in the scene each inside their respected drawers, 5 cubes to spawn in the scene each inside their respected drawers and 2 rectangles to spawn in the scene both inside their respected drawers. Now I want ONLY 1 object (actor) per spawner… and all other drawers can stay empty if nothing has spawned in them. Basically, I need a sort of SpawningManager that checks and handles what has spawned in the scene so it can limit the items to the numbers that I’d like. (“You’ve spawned the sphere in spawner#5 then no more sphere can spawn in the scene until end of play”)
So yeah… how do I achieve this? I realise it’s a tall order… if someone would be as kind to lend a hand, it would be so much appreciated!!..
Thanks! 
It’s pretty straightforward once you get the right approach. I’d recommend thinking about it in terms of a list of spawnable objects. The list lives in the spawn manager. Drawers ask the manager what they are allowed to fill themselves with.
One caveat, don’t do it all at begin player, otherwise all the drawers are fighting over who gets to spawn what. Much better approach is to let the drawer spawn as you’re opening it. That way you know you’re in control.
So the spawn manager just has an array of objects, you can shuffle the array to get them in random order. It has a function which tells you the next item on the list and then removes it from the list.
Do you get it? 
ClockworkOcean! I watch the YouTube clips on Unreal’s channel every week and you’re usually the top helper on forums…! Feels like I’m almost talking to a celebrity ahah! 
Good advice! I’m understanding the theory and logic behind it… but do to the fact I’m somewhat “new” to UE4 and scripting… I’m not sure how to easily handle the code part. Mind lending that brain of yours for a bit and sharing your knowledge with me with this gameplay mechanic, please? Visually, I mean. 
Thank you!
Well, I’ve gotta tell you that half the people I prepare FAB answers for actually marked the answers as correct I’d be a real rock star 
So, this is what I have, a level with the item manger and the draw ( which looks like nothing ):

And then I press O, which makes the drawer ask for items from the manger.
The begin play of the manger:

and the array and function ( in the manager ):
And then the code in the ‘drawer’:
Tell me if you get stuck 
Sorry for the late reply, had lots of work and plus FFVII Remake came out so I had to give it a playthrough!
Tested and works great! Can we add more… control over what spawns?
Question:
Say… I want 3 Cubes but the rest at 1.
Or 4 Spheres and 2 Cubes… could you help me with a counter system as well?
Let me know, Ocean!
Thanks again! 
Good to hear, please mark it as answerd 
If you want 4 cubes and 3 spheres, you just need to put that in the array, and it happens automatically.
Tell me what you mean about counters…
Would you mind showing how you’d set the number in the Array, please? Just so that I get this right…
Forget the ‘‘counters’’ that I mentioned. 
Also, the logic you’ve scripted ‘‘and then the code in the drawer’’ is in the actual ‘‘Drawer’’ BP or is it in the Level BP?
Thanks for helping out and clarifying everything!
This bit ( above ):

is where you put the stuff in the array. You can have one central array ( like I did ), or each drawer can have it’s own array.
The way I implemented it here, each drawer is a BP which gets the next item from the central actor.