subemitters.rst 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. .. _doc_3d_particles_subemitters:
  2. Particle sub-emitters
  3. ---------------------
  4. .. figure:: img/particle_sub_chain.webp
  5. :alt: Chained sub-emitters
  6. Sometimes a visual effect cannot be created with a single particle system alone.
  7. Sometimes a particle system needs to be spawned as a response to something that happens in
  8. another particle system. Fireworks are a good example of that. They usually consist of
  9. several stages of explosions that happen in sequence. Sub-emitters are a good way to achieve
  10. this kind of effect.
  11. .. figure:: img/particle_sub_assign.webp
  12. :alt: Assign sub-emitter
  13. :align: right
  14. Click to assign a sub-emitter...
  15. .. figure:: img/particle_sub_list.webp
  16. :alt: List particle systems
  17. :align: right
  18. \...and select one from the scene
  19. A sub-emitter is a particle system that spawns as a child of another particle system.
  20. You can add sub-emitters to sub-emitters, chaining particle effects as deep as you like.
  21. To create a sub-emitter, you need at least two particle systems in the same scene. One of them will be the
  22. parent and one will be set as the child. Find the ``Sub Emitter`` property on the parent
  23. and click the box next to it to assign the sub-emitter. You will see a list of available particle
  24. systems in the scene. Select one and click the confirmation button.
  25. Particle systems from instanced scenes can be set as sub-emitters too, as long as the
  26. ``Editable Children`` property is enabled on the instanced scene. This also works the other
  27. way around: You can assign a sub-emitter to a particle system in an instanced scene,
  28. even one coming from a different instanced scene.
  29. .. note::
  30. When you set a particle system as the sub-emitter of another, the system stops
  31. emitting, even if the ``Emitting`` property was checked. Don't worry, it didn't break. This happens
  32. to every particle system as soon as it becomes a sub-emitter. You also won't be able to
  33. re-enable the property as long as the particle system is used as a sub-emitter.
  34. .. warning::
  35. Even though the parent particle system can be selected from the list of available particle
  36. systems, a particle system which is its own sub-emitter does not work in Godot. It will
  37. simply not spawn. The same is true for any other kind of recursive or self-referential
  38. sub-emitter setup.
  39. Emitter mode
  40. ~~~~~~~~~~~~
  41. When you assign a sub-emitter, you don't see it spawn right away. Emitting is disabled
  42. by default and needs to be enabled first. Set the ``Mode`` property in the ``Sub Emitter`` group
  43. of the :ref:`ParticleProcessMaterial <doc_process_material_properties_subemitter>` to something other than ``Disabled``.
  44. The emitter mode also determines how many sub-emitter particles are spawned. ``Constant``
  45. spawns a single particle at a frequency set by the ``Frequency`` property. For ``At End``
  46. and ``At Collision`` you can set the amount directly with the ``Amount At End`` and the
  47. ``Amount At Collision`` properties.
  48. Limitations
  49. ~~~~~~~~~~~
  50. One thing to keep in mind is that the total number of active particles from the sub-emitter
  51. is always capped by the ``Amount`` property on the sub-emitter particle system. If you find
  52. that there are not enough particles spawned from the sub-emitter, you might have to increase
  53. the amount in the particle system.
  54. Some emitter properties are ignored when a particle system is spawned as a sub-emitter.
  55. The ``Explosiveness`` property, for example, has no effect. Depending on the emitter mode,
  56. the particles are either spawned sequentially at fixed intervals or explosively all at once.