x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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

Product Version: UE 4.10
Tags:
spawnmesh.rar (2.3 MB)
more ▼

asked Jan 06 '16 at 05:41 PM in Blueprint Scripting

avatar image

bsides
1 1 2 3

avatar image Trcioo Jan 06 '16 at 06:06 PM

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

avatar image bsides Jan 06 '16 at 06:26 PM

Blueprint

Level01 Spawn Points

![After Keypress

bp01.png (223.7 kB)
l01.png (2.2 MB)
avatar image bsides Jan 06 '16 at 06:28 PM

alt text

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

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.

more ▼

answered Jan 06 '16 at 06:42 PM

avatar image

Trcioo
475 25 8 30

avatar image bsides Jan 06 '16 at 07:44 PM

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. alt text

alt text

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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: alt text

spawnning.png (124.6 kB)
more ▼

answered Jan 06 '16 at 08:10 PM

avatar image

Trcioo
475 25 8 30

avatar image bsides Jan 06 '16 at 08:29 PM

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

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question