- Home /
Emit particles by distance of parent
I want to have different ParticleSystems on a gameObject depending on the game situation (e.g. red particles when hurting, green/blue particles for different buffs).
These particle systems should be instanciated from a prefab. As a prefab has to be a GameObject and not a component, my idea was to add the particle system to a transform and use the resulting GameObject as a Prefab. This Prefab is then added as a child to a GameObject.
This works fine with emission over time. However, it does not work with emission by distance, as the cuhild's position remains unchanged relative to the parent when the parent moves. Adding the particle system with the exact same settings to the parent however works.
Is there a workaround to calculate the distance for emission based on the parent's position and not the child's?
These are the settings of the particle system:
Answer by Meganion · Apr 19, 2017 at 06:24 PM
I've found the answer, probably your're using an parent or the object itself as dynamic rigidbody, on the game object Put an Knematic not simulated (not affected by physics) rigidbody on the game object responsbile by the particle.
More details on... https://forum.unity3d.com/threads/particle-system-distance-rate-rigidbody-2d.445785/
Answer by Glockenbeat · Jan 06, 2017 at 05:00 PM
Stumbled upon this as I had the same issue though it was working pre-5.5.
Do you by any chance have a rigidbody attached to the parent? If so it seems like as of Unity 5.5 you will need to make sure that either "Use Gravity" or "Is Kinematic" are correctly checked in order to make children emit by distance.
Your answer
Follow this Question
Related Questions
Particle System using distance emission stops emitting when script active.. 0 Answers
Shuriken "Distance" emission mode not working 1 Answer
How to emit particles in one direction only? 1 Answer
C# Particle emissionRate does nothing 1 Answer
how to emit particle system attached to object in code? 1 Answer