- Home /
help with Gui texts
basically, I have an object with multiple cameras surrounding it.
What i want is for each camera to have a GUI text to tell the player which camera it is. For example, a 6 sided dice has 6 cameras. Each camera shows only 1 side of the cube, I want GUI text to tell the player which camera s/he has changed to. Top side, bottom etc.
MY PROBLEM is that i can do this, but when the Object moves, the GUI texts DO NOT move with the Object. My Object has all the FPS scripts attached and so when i rotate or move, I repeat.. The GUI texts DO NOT move with the Object.
This ALWAYS happens when The GUI texts are a child of their cameras, when they are a child of the Object and when it is a child of the FPS game object.
What am i doing wrong?
Use a collider to detect when Camera 1, Camera 2 ect .. ect .. is within a set distance form the face of the dice then enable the mesh render of the GUI Text for a set time then disable it ..
Or set it up so when Camera 1, Camera 2 ect .. ect .. is enabled (chosen) again enable the mesh render of the GUI Text for a set time then disable it ..
Answer by Griffo · Oct 06, 2012 at 08:18 AM
I'd do it with a text mesh, Menu, GameObject, Create Other and 3D Text, type in the text box Camera 1, Camera 2 .. ect. now add the below script to it and drag your camera into cam in the inspector window, do this for each camera.
Change the values in the Vector3(0,0,0) to slightly change the position of the text if needed.
Hope that helps.
#pragma strict
var cam : Transform; // Reference to the camera
function Awake(){
}
function Start () {
}
function Update () {
transform.position = cam.transform.position + Vector3(0,0,0) + cam.transform.forward * 1;
transform.rotation = cam.transform.rotation;
}
Answer by stevecarzee · Oct 07, 2012 at 12:00 PM
But i also don't want to see all the 3D texts around the place... sorry that doesn't fix my problem
Your answer
Follow this Question
Related Questions
GUI HELP!!!!! 1 Answer
Creating Fps Game Menu 2 Answers
How to display text with the GUI Text object when using the Ultimate FPS Camera Asset 0 Answers
Is the GUI text still viable? 1 Answer
Level Button And Quit Button Android 2 Answers