Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
avatar image
0
Question by Terminal8 · Mar 20, 2012 at 12:40 AM · textparticleshuriken

Possibility of using the Unity Particle System (new or old) for text?

I'm trying to figure out how I can use text as a particle effect in either the new or old Particle systems in Unity.

I want to use it for indicating damage. ie: An object is hit with 5 units of damage and the particle system spawns a single particle with the text '5' over that game object in the prescribed movement/color/whatever pattern defined for the particle.

Ideally, a texture/material will be used that contains all the characters, rather than an individual texture/material for each character (using variable-width fonts so I can't guarantee each character has an exact amount of 'space' along a row or column in the texture).

I just can't see how I can tell the particle (via script) to clip out specific piece, or pieces (in the case of numbers with >1 digit) from the material and use it.

Any help would be greatly appreciated. (Perhaps there is a way of doing this via built-in Unity text handling?)

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
0

Answer by DaveA · Mar 20, 2012 at 12:47 AM

I suppose you could use the UV animation stuff, or Texture Sheet Animation. You can make a page-flip animation of the particle, so you'd have to get the right 'page' to show up. Not sure how well that would work.

You don't wanna just use a dedicated script? Probably simpler than trying to force a PS to do that.

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 DaveA · Mar 20, 2012 at 12:49 AM 0
Share

I'd really look into either using a GUITexture (in screen-space) or Text$$anonymous$$esh with a billboarding script on it (in world space). http://unifycommunity.com/wiki/index.php?title=LookAtCameraYonly

avatar image Terminal8 · Mar 20, 2012 at 02:32 AM 0
Share

Oh, using a dedicated script that handles everything is something that I was going to do initially, but I figured I'd see if I could dig up any (easy) way to do this within the existing particle system. Something that I might have been missing.

As I guess there really isn't a simple way to do it that way, I'll just write it myself outside of a particle system.

avatar image davethewave7 · May 27, 2016 at 06:12 PM 0
Share

How would I make this work in a separate script? What would be the best way to do go about doing that? Thanks.

avatar image
0

Answer by Eudaimonium · May 29, 2016 at 10:33 AM

I have created the damage numbers system for my game, it sounds like it's something you need but I have not used any particle systems. My idea was:

  • Create a "number" prefab which is a small UI panel with text field in it, and a script which accepts color, and a target Transform object

  • Script for the number object will recalculate the target Transform's world position into 2D canvas position using RectTransformUtility each frame, and position itself on the new calculated position

On an object which takes damage:

  • Instantiate a new empty gameobject simply for it's transform. In it's update, move the transform away from object slowly. Alternatively, use a rigidbodied prefab to have it behave something like Borderland's system if you wish.

On function which deals damage:

  • Call the damage on the object (to trigger it's 'target' prefab spawning)

  • Instantiate the damage prefab, set it's damage number and color, and assign the Transform to follow to the target's prefab transform.

Don't forget to have a lifetime for the numbers before they're gone, and if you plan on having a lot of damage numbers on screen, consider pooling the damage prefab numbers.

Comment
Add comment · 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

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

6 People are following this question.

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

Related Questions

Random Individual Particle Rotation(shuriken) 2 Answers

How to destroy live particle in Shuriken 1 Answer

Scale Shuriken Particle System with Parent Transform 5 Answers

particleSystem.Play works when playing the game within unity but not when i build a windows exe or html? 0 Answers

Shuriken particle system, how to emit? 2 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