Add Multiple Static Mesh Objects with Blueprint on input

This is probably really simple, but how do I make the static mesh object appear in each spawner location on a key press? (I have it assigned to 1 for now.)

If I hook it up to event begin play it behaves like I would like, but when I press a key only one object is added. Can anyone explain why this is happening, and how to make it work properly?

I have included a simple project that should demonstrate what is happening.

Any help is appreciated,

bsides

spawnMeshProject

Hi bsides, could you provide screenshots of your blueprint showing how you implemented your spawn system?

![Blueprint][1]

![After Keypress

You aren’t setting which static mesh you want to use on the new component, so you won’t see the object in the game.
Try dragging a wire from the return value of AddStatisMeshComponent and use SetStaticMesh.

I end up with the same results. When passed through begin play they all spawn, but on key press only one spawns. There has to be something happening during the event game play that isn’t occurring on button press.

The problem of only spawning 1 box is because inputs are only executed once and only at one place.
It’s getting the first actor spawn actor, executing your input and ignoring all other actors which want “read” the input too.

To solve this, first turn off all “Auto Receive Input” on all actors including the controlled pawn, go to Edit Menu → Project Settings → Input → and add a Action Mapping, on the example, is “INPUT_SpawnActors” with the key 1.

On your main character blue print, you need to do this:

Ok, so…you’re awesome! Thank you for the help…just getting my feet wet so this is all new to me. This does exactly what I needed it to do.

Thank you very much!
bsides