- Home /
How to get a 3D Text to appear on collision of another object?
Hello,
I understand how to get text to appear on collision from another object, but how to get 3D Text to appear?
The example to help with that very slim question ive put there;
(This is how to make text on gui appear) If object A(a circle) collides with a box collider, a script is activated(a script that is on the box collider) which will read "on trigger enter". This script will basically draw some text onto the screen. GUI.Label(Rect(20, 20, 600,40),"WORLDONE"); for example.
How would i got about to make it so that some 3D Text appears so i can click that text. For example;
If object A(a circle) collides with a box collider, some 3D Text will appear saying something like "click here", and if i were to click there, some other activity will happen.
So, instead of it being GUI.Label, is there some way to change that to 3D.Text?
I hope this makes sense on what i am trying to achieve.
Thank you to whom ever helps
Answer by Ashkan_gc · Apr 14, 2011 at 12:59 PM
you can have an object with a 3d text component and set it's text property to "" (i.e empty string) and then when the collision event accures you can set the text to what you want. to access the 3dText component, you need to use GetComponent.
there are other ways to do this too. you can add/remove the 3dText component or even instantiate the 3d text object on collision and then destroy it when you don't need it anymore.
so for example;
var tm : Text$$anonymous$$esh = GameObject.GetComponent();
tm.text = "click here";
?
Answer by Justin Warner · Apr 14, 2011 at 01:01 PM
Quick and dirty way =).
You can model the words "Click Me" (Almost all programs have a text feature, and if you really need one, ask, I can make you one real fast).
And so then, instantiate that when the player does the GUI thing, then you can have an on collision, on trigger, ray, w/e, and if the player does that, you can do the "some other activity".
Hope this helps? Lol.
This kind of did confuse me but thank you for reading my question and answering
Your answer
Follow this Question
Related Questions
3D Interactive Text 2 Answers
Script appears as null and not null at the same time 1 Answer
Player getting stuck in corners 0 Answers
Weird Collisions Between Paddle and Ball (Breakout) 0 Answers