- Home /
Question by
Tvorca · Oct 31, 2012 at 09:35 PM ·
3d texttransformstargets
Target 3D Text change to float and write to 3D text from run application.
Hi,
I have 2 problems with 3D text.
I need do mathematical operations.
public class Compute : MonoBehaviour {
//input public Transform A; //I need change A to float //A & A_output is 3D Text //output 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.
I need write number to 3D Text from run application. I need (in run application) to click on 3D Text and write number.
Comment
Answer by Anusha · Nov 02, 2012 at 03:34 AM
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();
}
Your answer
Follow this Question
Related Questions
How do i log a game objects position to text file 0 Answers
3D Text appears over everything 2 Answers
Is it possible to script a 3D Text? 1 Answer
Enable and Disable Particle Transforming to Random Position when Disabled 0 Answers
How to make my player play a vault animation when i collide into a vaultable object? 1 Answer