3d text backwards when facing camera

I am new to this forum but have been using Unity for a while now. I have made alot of progress with the game I am working on so far but am having a hangup on this one piece.

var Enemy: Transform;
var distance = 5;
var Explode : Transform;
var circle : Transform;
var projectile : Rigidbody;
//sounds for attacking
var SmiteSound: AudioClip;
//background texture
var attack : Texture2D;
var smite : Texture2D;
//textures for buttons
var xout : Texture2D;
var wasClicked: boolean = false;
//arrow shooting
var speed = 5.0;
var rotateSpeed = 3.0;
//health
var DamageNumber : int; 
var hp = 100.0;
var HitPoints = 100.0;
var ScorePoints = 2.0;
var track_speed : float = 2;
var look_at : Quaternion;
var enemies_list = new GameObject[10];
var aiming_at : int = 0;
var aiming : boolean = false;

var cameraToUse : Camera;
var SetPlayerName : String;
var TextMeshName : GameObject;

var style : GUIStyle;
	
//selection circle disabled
circle.renderer.enabled = false;
aiming = false;


function Start(){
	style.normal.textColor = Color.yellow;
	style.fontSize = 15;

	DamageNumber = Random.Range(1,(HitPoints/6));
}

function OnMouseUp() {
    wasClicked = true; // turns on button.
    circle.renderer.enabled = true;
    
    if(aiming == false)
		{
		update_list();
		if (enemies_list.length > 0) // If we don't have enemies, we don't need to do the quaternion code
			aiming = false;	//  for performance reasons.
		}
}

function OnGUI() {
          
	GUI.depth = 50;
    if (wasClicked) {
    	wasClicked=true;
    	//show inventory bar
		   
		   GUI.BeginGroup (Rect (Screen.width / 2 - 450, Screen.height - 49, 900, 49));
			
			if(GUI.Button (Rect (43,8,39,40), attack, GUIStyle.none)){
				//BuffPlate.active=true;
				audio.PlayOneShot(SmiteSound);
			
				//instantiate the projectile
		        var instantiatedProjectile : Rigidbody = Instantiate (projectile, transform.position, transform.rotation); 
			
				//move the projectile 
				instantiatedProjectile.velocity = (enemies_list[aiming_at].GetComponent(Transform).position - transform.position)*speed;
		        Physics.IgnoreCollision(instantiatedProjectile.collider, transform.root.collider);     

   				DamageNumber = Random.Range(1,(HitPoints/6));
		        print ("hit : " + aiming_at + " with " + DamageNumber + " damage");
		        hp = hp -= DamageNumber;
		        Destroy(instantiatedProjectile.gameObject, 5); 

			} 
			if(GUI.Button (Rect (79,8,39,40), smite,GUIStyle.none)){
	               
			} 
	        
	        if (GUI.Button(new Rect(408, 8, 39, 40), xout,GUIStyle.none)) {
	            circle.renderer.enabled = false;
	            wasClicked = false; // turns off button.
	        }
        
			GUI.EndGroup ();
    }
}

function Update(){
	
    SetPlayerName = Enemy.name;
    TextMeshName.gameObject.GetComponent(TextMesh).text = SetPlayerName + "

\r" + hp;

	if (Input.GetKeyDown("1")) {
		if (wasClicked) {
	    	wasClicked=true;
			audio.PlayOneShot(SmiteSound);
			
			//instantiate the projectile
			var instantiatedProjectile : Rigidbody = Instantiate (projectile, transform.position, transform.rotation); 
			
			//move the projectile 
			instantiatedProjectile.velocity = (enemies_list[aiming_at].GetComponent(Transform).position - transform.position)*speed;
			
			Physics.IgnoreCollision(instantiatedProjectile.collider, transform.root.collider); 
			
			// Send a damage message to the hit object          
			DamageNumber = Random.Range(1,(HitPoints/6));
			print ("hit : " + aiming_at + " with " + DamageNumber + " damage");
			hp = hp -= DamageNumber;
			Destroy(instantiatedProjectile.gameObject, ScorePoints); 
			
			//print ("aiming at : "+aiming_at);
			}
   	}
	
	if(aiming == true)
	{	
	
	look_at = Quaternion.LookRotation(enemies_list[aiming_at].GetComponent(Transform).position - transform.position);
	look_at.x = 0;
	look_at.z = 0;
	transform.rotation = Quaternion.Lerp(transform.rotation, look_at, track_speed);
	// This will make the character turn to the enemy
	
	// The next part handles the switching between enemies
	if (Input.GetKeyDown("-"))
		{
		if (aiming_at < enemies_list.length) 
			aiming_at++;
			
		else
			aiming_at = 0; 
		}
	
	if (Input.GetKeyDown("="))
		{
		if (aiming_at > 0)
			aiming_at--;
	
		else 												
			aiming_at = enemies_list.length -1;
		}
	}
	 
	if (hp <= 0)
	Destroy(gameObject);
	
	if (hp <= 0)
	{
	    print ("scores: " + PlayerPrefs.GetString("playerName") + "--" + ScorePoints);
		//Instantiate(Explode, transform.position, transform.rotation);
		
		postScore(PlayerPrefs.GetString("playerName"),ScorePoints);	
	}
}
function update_list(){
		enemies_list = GameObject.FindGameObjectsWithTag("Enemy");
}

function postScore(name, score) {
    //var hash=Md5.Md5Sum(name + score + secretKey); 
 
    var highscore_url = addScoreUrl + "name=" + WWW.EscapeURL(name) + "&score=" + score;
 
    // Post the URL to the site and create a download object to get the result.
    hs_post = WWW(highscore_url);
    yield hs_post; // Wait until the download is done
    if(hs_post.error) {
        print("There was an error posting the high score: " + hs_post.error);
    }
}
		
@script RequireComponent(AudioSource)

This piece of code allows me to select the NPC, show the attack buttons, and calculate the death, then destroy and update scoring.

the problem is that the 3d text is backwards and not facing the camera. I did use the CameraFacingBillboard.cs example HERE and now the 3d text faces the camera as I walk around the NPC. However, the text is backwards and I cannot figure out how to flip it around. I am also using Unity 4 and a lot of the examples that I see are for Unity 3. Does this make a difference when doing the scripting?

the specific place the name of the NPC is placed is the first two lines of the update function.

SetPlayerName = Enemy.name;
TextMeshName.gameObject.GetComponent(TextMesh).text = SetPlayerName + "

\r" + hp;

I have tried to do several examples and nothing seems to work, or breaks the code. Can anyone help?

Thanks.

There’s no difference between Unity 3 and Unity 4 with this kind of scripting. Most likely you’ll have to modify the CameraFacingBillboard script to rotate the text 180 degrees around the Y axis. Take a look at the Transform script reference - there are a couple ways to rotate objects, and there is example code for each.

Replace Vector3.back in your CameraFacingBillboard script with Vector3.forward (assuming you’re using the non-modded version).