I am trying to implement a game like BBTAN with Unity5, the point I got stuck on is drawing numbers onto the boxes in a proper way. I have done it by adding Canvas and Text elements on each boxes and set the following properties of them in order the fit the text inside to the canvas:

Render Mode: World Space Dynamic Pixels Per Unit = 1250 Reference Pixels Per Unit = 100

Even though the text fits into the box, its being rendered without antialiasing. And it looks like this (The box is on the right hand side is the Screen Space Overlay Canvas, for comparison purpose):

enter image description here

I have two questions to ask:

  1. Is adding canvas to each block an efficient way? If not how should I implement drawing dynamic numbers (Changing when got hit) onto these boxes?
  2. Is "changing the dynamic pixels per unit" the correct way to achieve this goal? If so, how can I fix this anti-aliasing problem?

Thanks in advance for any help!


Per #1: Yeah, it's fine. More canvasses is better than too few (because of the way they have to sort everything when something changes). Don't worry about it.

Per #2: What I do for canvas text items is set the scale to (0.5,0.5,0.5) and double the font size. But that's for screenspace text. I haven't messed with worldspace text yet. Try doing the reverse: double the scale and halve the font size. That will probably be too extreme, but if it looks more-better, see if you can find a value in between that works for you (maybe 1.5 scale and 0.66 on the font).

  • \$\begingroup\$ This solution lead me to the exact point that I want! Thanks a lot first, and I would like to ask whether if there is a better implementation or component should I use exists that I can search for, or is this a pretty handy way? Because the final values I got at the end are scale to 0.015 for all dimensions and use the font with size 37 \$\endgroup\$
    – Tolga Şen
    May 1 '17 at 19:31
  • \$\begingroup\$ Probably not. The scale and font settings might even be specific to your project (i.e. the world-scale being used). A first person shooter where 1 unit = 1 meter might have a completely different text scale needed to look "right." \$\endgroup\$ May 1 '17 at 20:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.