So I have my code set to spawn X amount of items randomly, my issue is, how can I now make at least 1 item spawn in each area of my large map? Like one per room, with like 3 random spots available per room/area? Right now, there is always a chance that the items will spawn near each other, or all on one floor, etc.
Create an ItemSpawner actor class. Make this Actor have an array of Vector positions, with the “show 3d widget” checkbox ticked as well as “instance editable.” Also give it an “actor to spawn” class reference.
When starting, pick one random point from the vector, and spawn an instance of the given class at the given picked point.
Add an instance of this spawner actor per room.
In the editor, when you add elements to this array, they show up as little diamonds in the editor window. Select a diamond and use regular move widgets to move it around:
If this is networked, you’ll want to Switch Has Authority in the Begin Play, and only do this when you actually have authority. The spawner doesn’t need to replicate (or even load client-side,) as long as the spawned objects do.
I wanted to add a photo of the code im currently using to randomly spawn the items.
I have the items spawning, but how do i get them to spawn randomly, as all spots I pick are all spawning? And is there anyway to incorporate this with some of the code im already using?
Never mind, I got it working, just need to add it to my code now so i have to correct number of items spawning per game.

