- Home /
Changing TEXT (text value) within 3D text
How in the mother of God, can text value in 3D Text, be changed IN JAVASCRIPT?
Now, my code is this;
GetComponent.().text = "TRALALA"
Now, this works! Excellent, even! It will transform text value, whatever it was to "TRALALA". But, there is one small, tiny problem. How, but HOW, can i put "space" between words?
like:
GetComponent.().text = "I am riding a bicycle." ofc it won't work. Is there a special symbol for spacing, or what should I do?
Don't write "solved" in the title, mark the answer as accepted.
Yeah, i just noticed that. The "solved" i lefted only for info. I didn't knwo how to accept the answer, and today I found that "ok" sign. Anyway, I won't do it again. Now I know.
Answer by Mike 3 · Mar 15, 2011 at 06:55 AM
That should work fine
GetComponent.<TextMesh>().text = "I want to ride my bicycle";
works perfectly well for me in javascript
Oh my God.. It works, LOL! I thought that noone will answer, 'cause, you know, everywhere on forums there is not much, how to say, feedback. I thought this is a waste of time, but, i have searched all over the internet, couldn't find it. So, I have to put .... Thanks a bunch, i tried it, it works! I am doing a menu for FPS game. Very neat menu too. But, not so good with scripting, I work with unity for 3 or 4 days now. It's not a bad menu, I will post it later when it's finished. Tell me one more thing, are u familiar with the iTween for unity?
Ok, thanks anyway. One more thing, if I may ask, I don't know much about program$$anonymous$$g. But, Unity uses JavaScript. Now, is this implementation of Java script in Unity different from how should I say.. The Java Script original? (now the trolls are dying from so much possibilities to say all kind of things to me :D )
It's not that similar, some of the syntax is the same, but how you use it is fairly different. Small note - you may want to check out the irc channel ( #unity3d on irc.freenode.net ), easier to have conversations ;)
Answer by DaveA · Mar 15, 2011 at 07:23 AM
Maybe the spacing in the font you are using is pretty thin? Try another font or play with the font settings.
Your answer
![](https://koobas.hobune.stream/wayback/20220613112901im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Unity3d Battery Life Change 3D text Java script 0 Answers
Change camera on text click? 1 Answer
Changing the type of a variable 2 Answers
Limiting the amount of times a button can be pressed? 1 Answer
On Touch change color 2 Answers