- Home /
Unity 5.5.0 Particle System - Emission Module - Rate over Distance bug
After upgrading my project from Unity 5.4.x to Unity 5.5.0 most of my particle systems stopped working. I checked it, and found out that all Particle Systems that used Rate over Distance in Emission Module stopped working. In editor when I move the Particle System manually on the scene it works just fine, but not when I play. So then I started checking everything carefully and found out the culprit. I used "transform.position" to move my projectiles etc. and this function no longer affects Rate over Distance. When I changed the script to Rigidbody and AddForce function it suddenly started working.
No idea if this is intended by them or simply a bug, but I didn't find anything online regarding this change in 5.5.0. It always worked, and I don't feel like changing all my code and fighting with AddForce to achieve similar values as in transform.position.
Does anyone else noticed this? I submitted it as a bug, but it might take weeks for them to answer it.
I have the same problem in my case I'm moving object with Rigidbody $$anonymous$$ovePosition, and turning it with Rigidbody $$anonymous$$oveRotation. $$anonymous$$y object has particle system with rate over distance emmision (simulation space: world). And only strangly only $$anonymous$$oveRotation couses particles emmision and $$anonymous$$ovePosition doesn't, so they are appearing only when turning. Using Unity 5.50f3
Answer by Jodwig · Dec 31, 2016 at 03:24 PM
So, it's a problem with Rigidbody. When your object has non-Kinematic Rigidbody attached to it, it will screw your Rate over Distance if you are trying to move it with transform.position. It's not a bug, but a Unity change in 5.5.0: https://issuetracker.unity3d.com/issues/particles-emission-over-distance-not-working-when-moving-parent-with-not-non-kinematic-rigidbody-slash-rigidbody2d
And as I said, I contacted Unity Support and that's what they said:
"When a RigiBody is attached to a ParticleSystem we now use the velocity from the Rigidbody instead of calculating it.
The reason for this is that the Rigidbody and the particle system would have different velocity values which would cause particle to behave incorrectly, particularly at large velocities.
We now allow the Rigibody to control the velocity when attached (and kinematic). By dragging a particle system in the scene the Rigidbody will not update its velocity, however child systems calculate a local velocity using positional difference and then apply this to the Rigibody velocity which is why it still works with children providing they do not have a Rigibody attached.
If you wish to drag the object in the scene then you would need to either remove the Rigidbody or write a script to update the Rigibody velocity value to match the dragging action.
There is a small icon to indicate that a Rigidbody is being used in the Inherit Velocity module, we will move this to the main module so it is more obvious."
Hope it helps someone.
Answer by CLaferriere · Jan 09, 2017 at 11:37 AM
I'm having a problem where my character has a particle effect behind them, and moves with velocity. However the character can dash forward where I use addforce to push them. The particle effect with rateOverDistance works fine for movement, but as soon as you dash with the player and addforce takes over, the particles don't emit. It works only when the player is holding down the movement joystick while dashing which leads me to believe it rateOverDistance needs just a velocity and not addForce.
Answer by Meganion · Apr 18, 2017 at 04:13 PM
Hey,i've made an workaround at: https://forum.unity3d.com/threads/particle-system-distance-rate-rigidbody-2d.445785/
Basically you do have to add another gameobject with rigidbody knematic not simulated and put the particle system inside that, it will work perfectly
I actually figured it out a while ago, but you had a different solution then I did, I'll post my solution later if you're interested.
Answer by Meganion · Apr 19, 2017 at 06:25 PM
Hey @Jodwig, i've found the answer for this problem, i've posted the solution on the link below https://forum.unity3d.com/threads/particle-system-distance-rate-rigidbody-2d.445785/
Answer by sirleto · Aug 27, 2021 at 08:48 PM
i have had this same problem in 2021 (using unity 2019) and i read this thread and the one linked by user meganion.
i found the described behavior logical but the solution(s) confusing.
what i did was this:
as a "bullet" i am having a particle effect with "emission: rate over distance" with non-kinematic rigidbody (parent). it worked well even though it has the above described situation.
i added a "homing" effect, by putting a Rigidbody.AddForce() in (Fixed)Update() which required me to set Rigidbody.Velocity() to zero or else my homing wouldnt work.
with this change the particle effect was lost (not emitting anything)
what i needed to do to solve it was now this:
rb.velocity = this.transform.forward my_custom_speed Time.fixedDeltaTime;
so as a summary: having the rigidbody was no problem. starting it with AddForce() was no problem. but adding homing effect with AddForce() in each FixedUpdate() AND setting velocity manually to zero (which is maybe stupid, i dont know, it just worked for me) caused the velocity to stay zero. setting the velocity manually worked, but only when i multiplied it by Time.fixedDeltaTime (because its a physics effect).
hope this helps someone else :-)
feel free to tell me where my whole logic is stupid, i would love to learn to do it better :-)
Your answer
Follow this Question
Related Questions
Shuriken particle are clipped by Skinned Mesh Renderers? 0 Answers
[Newbie] Particle System does not work right. 1 Answer
Anyone on Unity 5 beta 12 getting this crash? 0 Answers
MovieTexture black on Mac build 1 Answer
Ui extension bug 0 Answers