Target 3D Text change to float and write to 3D text from run application.


I have 2 problems with 3D text.

  1. I need do mathematical operations.

    public class Compute : MonoBehaviour {

     public Transform A; //I need change A to float
                         //A & A_output is 3D Text
     public Transform A_OUTPUT; // here i write A
     void OnMouseDown(){
     	A_OUTPUT = A*6;
     	A_OUTPUT.transform.guiText.text = A_OUTPUT.ToString();

This C# script I appli on 3D Text.

  1. I need write number to 3D Text from run application. I need (in run application) to click on 3D Text and write number.

public Transform A; //this is your 3D text from where you take the input

public Transform A_output; //this is your 3D text where you want to display the result A*6.

void OnMouseDown()
     TextMesh Tx = (TextMesh) A.gameObject.GetComponent("TextMesh");
								int A_value = int.Parse(Tx.text);
int A_output_value = A_value * 6;
 TextMesh Tx1 = (TextMesh) A_output.gameObject.GetComponent("TextMesh");
Tx1.text = "" + A_output_value.ToString();