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"

How do you spawn an emitter at a collision location?

Ok, so I'd like a particle system to spawn based on the collision of two meshes. Is there a way to tell UE4 to find this collision location and spawn the emitter there?

Product Version: Not Selected
more ▼

asked Jun 02 '14 at 10:55 PM in Blueprint Scripting

avatar image

3 6 10 10

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

Hey NullFX -

Even easier, in either case you will be calling an Event Hit and you can add in a Spawn Emitter based on the location of the Event Hit call. Here is the setup based on the first person blueprint template, it is assigned in that template to the My Projectile Blueprint. You will want to make sure that whatever particle system you are generating is finite in length and not infinitely looping because then the emitter will exist forever (unless that's what you want in which case there you go.)

alt text

projectile.jpg (171.6 kB)
more ▼

answered Jun 04 '14 at 03:25 PM

avatar image

Lovecraft_K ♦♦ STAFF
36.8k 702 256 733

avatar image NullFX Jun 10 '14 at 05:17 AM

That works wonderfully, the only problem is that it's spawning the particles regardless of what it's colliding with. Is there a way to make it only fire if it hits a certain mesh?

avatar image Lovecraft_K ♦♦ STAFF Jun 10 '14 at 02:42 PM

You can do a Branch based on the specific material that the object has assigned. Again this blueprint is from My Projectile and the 1st person template, you will need to assign a new material to all objects (including all sides of the Geometry brushes) and make sure you have the material of the object you want to spawn emitters assigned in the blueprint.

alt text

Eric Ketchum

spawner.jpg (107.7 kB)
avatar image NullFX Jun 11 '14 at 02:47 PM

Sounds easy enough. What function is the "= =" that connects to the branch and is there anything important going on farther off to the right?

avatar image LitStudio Jun 11 '14 at 04:41 PM

the "==" function you can use when you pull a actor line in event graph and tap "=" key....this is a great function and will see if the object from one input is equal to the other below....if is...the bool connected in Branch will be true....if is not....false...

avatar image LitStudio Jun 11 '14 at 04:46 PM

I don't think is there anything to the right side much important....because your primal question only reach to that point....

avatar image Lovecraft_K ♦♦ STAFF Jun 11 '14 at 05:25 PM

Hi NullFX -

Sand is right the only thing to the right of the image I posted was the turn into Physics Objects stuff from the original Blueprints I just moved it over to let you see the layout of the new nodes.


Eric Ketchum

avatar image NullFX Jun 13 '14 at 02:52 AM

I'm not understanding where it's pulling the external material reference from...When I put all of that in it doesn't spawn the particles with any collision at all. Here's what I have going so far.alt text

untitled-2.jpg (390.6 kB)
avatar image Lovecraft_K ♦♦ STAFF Jun 13 '14 at 01:55 PM

Hi NullFX -

Ok so you are doing a check of the material that is set on the object your projectile is hitting and comparing (==) it with a specific Material. Since the comparison likes to look at Base Materials and not Material Instances, that is the Get Base Material node. In the comparison you should be choosing the Base Material for the object(s) you want to hit.

Always remember too that using a print string and playing in editor will allow you to see exactly what a particular node is returning, so in your example hook up a print string to the Output of Get Base Material and have the string print the return value. What it returns is what you should be comparing to in the == node.

On a side note, I would also hook up your false node from the 1st Branch your sequence to the input of the second branch that way your particles will still be destroyed, otherwise you will have a large amount of particles just lying around.

Hope that explains things a little better -

Eric Ketchum

avatar image NullFX Jun 13 '14 at 09:03 PM

Fantastic! Everything is working correctly. As it turns out for some reason the base texture is stored in two different folders and I was using the one in the wrong folder (Not sure why it's saved twice). Thanks for all the help!

(comments are locked)
10|2000 characters needed characters left

Hi NullFX -

I made the assumption that you two meshes are physics based collisions, so if that is not true let me know, but here is the best way I could find with an Event OnActorHit >> Break Hit Result, impact point >> location, Make Transform, return value >> relative Transform Add Particle System. Here is a screenshot of the blueprint:


The DoOnce node is in there to keep the bounce of my physics object from spawning two systems.

Thank You

Eric Ketchum

dynamicspawn.jpg (130.7 kB)
more ▼

answered Jun 03 '14 at 07:49 PM

avatar image

Lovecraft_K ♦♦ STAFF
36.8k 702 256 733

avatar image NullFX Jun 03 '14 at 10:38 PM

It won't be two physics based actors. One will hopefully be like a melee swing or projectile attack from a character and the other will be a static mesh in the scene with colliders attached to it.

(comments are locked)
10|2000 characters needed characters left
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