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"

Particle spawn on surface using surface normal

If I have a particle system with two emitters in it, and the first particles colliding with a surface spawn new particles at the hit locations, how do I switch the new particles from facing the camera to facing the surface normal of the hit surface?

Do I have to use Source > Event Generator Type > Blueprint ?

Product Version: Not Selected
Tags:
more ▼

asked Sep 08 '14 at 03:07 AM in Using UE4

avatar image

tomofnz
1.2k 46 47 88

avatar image tomofnz Sep 08 '14 at 09:24 AM

Can I bump this?

avatar image Lovecraft_K ♦♦ STAFF Sep 08 '14 at 09:25 PM

Hey tomofnz -

You should be able to set the 2nd emitter's particle orientation to PSA_Velocity and it will inherit the Surface Normals direction based on the collision's module.

Thank You

Eric Ketchum

avatar image tomofnz Sep 09 '14 at 11:43 AM

Thanks - I will try it! PSA_Velocity in the spawned particle Required section works for fixing the orientation, but at the same time the particles lose their own size and life settings and seem to inherit from the original emitter instead.

avatar image Lovecraft_K ♦♦ STAFF Sep 09 '14 at 01:12 PM

Hey tomofnz -

Try to uncheck the inherit velocity setting from the collision module and Event Generator.

Thank You

Eric Ketchum

avatar image lackthereof0 Sep 09 '14 at 11:54 PM

It looks like this PSA_Velocity technique doesn't work for mesh particles. Is there a way to orient mesh particles to the normal of the surface?

avatar image tomofnz Sep 10 '14 at 11:13 AM

Inherit Velocity only seems to show in the produced/spawned particles, not the source particles. I can find only one case, and if it's off then the new particles don't stick on the surface at all. I made a video : https://www.dropbox.com/s/6jy2sapamo5rm58/tomofnz_ParticlesIssue.mp4?dl=0

avatar image Lovecraft_K ♦♦ STAFF Sep 11 '14 at 08:50 PM

Hey tomofnz -

Thank You for the video that helped clarify exactly what you are looking for. To achieve this exact behavior will take some use of blueprints and passing values into the particle system. I will work on developing a simple sample and post it when I am done.

Thank You

Eric Ketchum

avatar image tomofnz Sep 11 '14 at 10:16 PM

Awesome - I'll look forward to it!

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

1 answer: sort voted first

Hey Tomofnz -

Well better really late than never, but I finally got time to set down and work on this issue again. It is actually fairly complicated because Rotators are extremely complicated and passing modified values between components can be tricky. That being said here is the Particle System break down which is a fairly easy setup. I have one emitter that functions as a drop and an event generator feeds the spawning of another emitter (Event Receiver) on Collision. This Event Generator allows our Blueprint to read that Hit Location. In the Collision Spawned Emitter, I have an Initial Mesh Rotation (this should work with a normal sprite as well just use Initial Rotation instead of Mesh Rotation) set up with a Vector Particle Parameter which we will set in our Blueprint.

alt text

Next the Blueprint, make an actor blueprint with your Particle System like follows:

alt text

We Start with the OnParticleCollide Node which registers each collision from that event generator, we take the normal of the point of collision and take a Cross Product of the Impact Normal and the Up Vector Normal (0,0,1) then normalize; this serves as the axis of rotation. Next we take the normal again this time running the Dot Product of the Impact Normal and the Up Vector (0,0,1) when then take the arc cos (inverse of cosine) of the Dot Product; this serves as our angle. Next we make a Rotator from our Axis and Angle using the Rotator from Axis and Angle Function. We then Break the Rotator because our Particle System wants a Vector value not a rotator and in Cascade Rotators run from 0 (0 degs) to 1 (360 degrees) which is what we do next but because we are dealing with Radians which run from 0 (0 degs) to 2Pi (360 degrees) we need to normalize to that range. After normalizing for range we need to take the inverse of each float (*-1) which keeps the Particle rotating the correct way in relation to the floor. Finally we make a vector out of our broken rotator pieces making sure to align XYZ correctly to (Roll, Pitch, Yaw) and pass the resulting vector into our Vector Parameter.

Some warnings about this setup it is once at spawn only for each particle. Each particle can change it int. rotation but it cannot change dynamically once spawned. So, this system would work will on an environment that is not moving but dynamic environments will cause problems unless it moves between the particle spawns.

Thank You for your patience -

Eric Ketchum

more ▼

answered Mar 09 '15 at 08:24 PM

avatar image

Lovecraft_K ♦♦ STAFF
36.7k 702 260 735

avatar image tomofnz Apr 03 '15 at 11:45 AM

My thanks also way late ... I didn't notice an answer was posted till today. I will check this out ; looks like some nice maths.

(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