Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
1
Question by Tronotrond · Mar 02, 2017 at 03:21 AM · materialtextparticlesystemparticle system

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?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
9
Best Answer

Answer by LiloE · Mar 02, 2017 at 06:58 PM

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

And the subject is: Particles with Dynamic Text :-)

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:

final result

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


2017-03-02-20-16-42-unity-550f3-personal-64bit-the.png (113.1 kB)
Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Kento184 · Jul 21, 2017 at 12:07 PM 0
Share

thank you so much! This is helpful :D

avatar image SavedByZero · Nov 09, 2018 at 02:58 AM 0
Share

This is pretty awesome, but what if you want to randomize the text for each particle?

avatar image Rokugan90 · Aug 07, 2019 at 07:46 AM 0
Share

Really useful!

A tip for all those who will stumble here. If you wanna get rid of that slight border around the text simply enlarge the panel from step 10 to go beyond canvas boundary.

avatar image
0

Answer by Tronotrond · Mar 05, 2017 at 02:17 AM

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

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image b1naryatr0phy · Apr 18, 2017 at 07:39 PM 0
Share

Please don't add comments as answers, that's what the "Add comment" buttons are for.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

111 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

What basic shader is needed for change the color on particle system with particles based on a spritesheet? 0 Answers

Turn on and off ParticleSystem and LineRenderer on same object at the same time 1 Answer

Particles not showing 0 Answers

Particles trail following the player 0 Answers

Is there any button to control trails emitting in particle system? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges