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,
asked Jan 06 '16 at 05:41 PM in Blueprint Scripting
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.
answered Jan 06 '16 at 06:42 PM
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:
answered Jan 06 '16 at 08:10 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here