Is it possible to create Text string particles?

Hi, I’d like to create a (2D) particle system where the particles would be a number or a word.
I’d like the option to change the text via code as I spawn a new particle system, but I am trying to avoid manually creating a bunch of diffuse bitmaps with just numbers and words, as doing it via Text and code seems like more optimized option…?

I guess I am looking for a way to convert a UI Text or similar into a Material, or use the Text as an Opacity map for the material, which I can apply to the particle system.

Is it possible, any suggestions?

Thanks to your question, I’ve created my first Unity tutorial video.

And the subject is: Particles with Dynamic Text :slight_smile:

The idea is to use another camera and a canvas

The second camera renders its own overlay canvas onto a render texture.**

This texture will then be assigned to a material that will be used by the particle system.

Since the material keeps changing when you change the text, the particles are also changed.

Here’s a little screenshot:

Here are the steps:

(This is for advanced users, if you get stuck, watch the video tutorial below)

  1. Create a new 2d scene (works also on 3d scene but that’s how I did this)
  2. Create a particle system and set it in front of the camera
  3. Change particle settings so that particles will be slower and bigger:
    I set Start Speed to 1 and Min Particle Size to 0.1
    Tweak these values to your liking
  4. Create another camera, let’s call it Text Camera
  5. Set it to be orthographic and move it a bit so it will be out of the way
  6. Create a new Render Texture, call it Text Renderer
  7. In the Text Camera set the target texture to be the Text Renderer
  8. Disable the audio listener on Text Camera, as you can’t have two of them in a scene.
  9. Create a canvas, set it to Screen Space - Camera and select the text-camera as its camera
  10. In the canvas create a panel, set its color to black and full opacity (by default it’s half!)
  11. Add a text object to the panel, let’s leave it with the default name Text, set its color to white and resize it to fit nicely inside the panel
  12. Check that in the Text Camera you can see the text clearly and that it more or less fills the frame
  13. Create a new material, call it Text Material and set its shader to one of the particle shaders, I used “Mobile/Particles/Additive”
  14. Set the texture of the Text Material to be Text Renderer
  15. You should now see in the material preview the current text that you entered in the Text object
  16. Go to the particle system and set the material in the renderer to Text Material

And finally, the tutorial video

which explains everything step by step

Awesome! Thank you so much! Your instructions worked like a charm, and is exactly what I was wanting! :smiley: