- Home /
Show 3d text after collision
hello guys and girls,
i'm currently in the process fo writing a shoot em up on unity, but am having trouble getting a 3d text to appear within my function ontrigger. I'm using particles aswell, maybe that is the problem.
here's my code for the collision between bullet and enemy.
function OnTriggerEnter(otherObject: Collider){
if(otherObject.gameObject.tag == "enemy1"){
playerScript.playerScore +=100;
otherObject.gameObject.transform.position.y =7;
otherObject.gameObject.transform.position.x = Random.Range(-6,6);
var tempExplosion: Transform;
tempExplosion = Instantiate(explosion,transform.position, transform.rotation);
Destroy(gameObject);
Any ideas?
Thank you
Answer by wipeout · Jun 01, 2011 at 03:23 PM
That might just do it, i'll try it ou ad get back to you
Answer by Anxo · Jun 01, 2011 at 03:13 PM
You could add a 3D Text in your under your enemy and disable it. in the collision you could then have.
otherObject.gameObject.BroadcastMessage("Activate");
on the enemy you need the:
var 3Dtext;
function Activate(){
3Dtext.enabled = true;
}
This would need tweaking but I think you get the idea?
Your answer
Follow this Question
Related Questions
3D Text Mesh produces wrong letters 1 Answer
Gameobject: 3D Text, how to change text? 2 Answers
editable 3d text? 2 Answers
Center TextMesh to 3DModel 1 Answer
3D Text fading out 2 Answers