- Home /
Detecting a word clicked on in 3D text?
Hey!
So, I'm interested in making some 3D text which can be broken down into sounds -- I've attached an image which, hopefully, will describe what i'm talking about. I know how I would go about creating the sound system for breaking down the words -- but I don't know if there's any way to know, definitely, which word in a 3D text object that a user is clicking on, and then somehow separate that word from the others surrounding it. The ultra-expensive way, I guess, would be to just have a 3D text object for each clickable word. But this might get a bit hairy if there are too many words, right? Are there any plugins that make a single 3d text able to detect which word/character has been clicked on?
If you want to thicken/enlarge that one word, wouldn't it have to be a separate 3DText?
As far as size/spacing of words, best way I've found is to use the GUIStyle size command, and then trial&error 1 pixel of a certain font size equal 0.021 meters (I just made that # up) in a 3DText. Unless you have a monospace font (which maybe you do?) then just make a 20 letter 3DText, measure and divide by 20 (more letters to reduce rounding error of measuring just one) to get meters/letter.
Ah, the $$anonymous$$ono space font information seems very important. Thanks for that. I guess it would have to be separate -- but as long as I could figure out which word I was clicking on, and I could guarantee that each of the letters was the same size, then I could put another 3D text on top of the first, and just fade out the first one before making the second larger.
"fade out the first one": now you need to make 2 new 3DTexts with just that word. Any way of doing it, I think you need code to create the single word at the correct position, which will be a pain.
Do you really want to remake the sentence into part1, the clicked word by itself, then part2? It would be easier to make every word by itself to begin with. Then it won't be much extra work to give each 3DText a collider.
Answer by Catlard · Oct 24, 2013 at 02:15 AM
Ah! I figured it out, and have made it a package for easy downloading. It uses, at max, two 3dTexts to do what we were talking about. I hope it helps someone else! I tried uploading it to this, but it wouldn't take. Funny that unitypackages won't upload to unity answers. What else WOULD you upload?
https://mega.co.nz/#!t9AkGQzb!XqRQmlQR2LmE7znZU4MTi3cLvc8AyHJA6lDjpBZcLBg
Your answer
Follow this Question
Related Questions
How do I implement In-App purchases for Windows/Windows Phone? 2 Answers
iOS Launch Options 0 Answers
Calling an Android plugin from Javascript? 0 Answers
Is there any method to callback from plugin (Windows)? 2 Answers
Plugin for Facebook Native Ads 0 Answers