Does anyone know how to display X, Y and Z coordinate Axis on the game scene?
As i have tried using the following coding:
print ("Camera displays from " + camera + " to " + tiltY + " pixel");
which will display my X, Y and Z coordinate axis out. However, i would like to display all their values on the game scene when i click on the debug button as well. Does anyone have any advice so that i am able to achieve that? Thanks
Hi Potan, thanks for the reply. Well, as my X, Y and Z coordinate Axis will be consistent changing upon clicking on the debugging button. Can i still use the GUIText object?
Well may i know what does Debug Console did as well? Thanks
Sorry for the confusion. Sincerely apologise if i have created any. Well what i actualy wanted is that i wanted to display my X, Y and Z coordinate Axis on my game scene while having my game scene to continue playing in a debugging mode?
As when my game scene have been debug, my X, Y and Z coordinate will keep on changing therefore i would like to programme it on my game scene to let my users to be able to view the coordinate on where my camera positioning at? Does anyone have any idea, advice or recommendation? Thanks in advance.
-
What do you mean “my coordinate axis”? The world’s coordinate axes? Some model’s coordinate axes? Other?
-
Do you want the axes drawn as little arrows in place in the actual game like Unity’s Scene view displays? Or do you want to display them as text numbers as part of a user interface similar to what’s shown when you do call Print?
If you just want to display something like is shown in your Print statement then just do something like this:
function OnGUI () {
var tString = "Camera displays from " + camera + " to " + tiltY + " pixel";
GUI.Label( Rect(10,10,320,20), tString);
}
That will display your string in a small label in the upper left corner of the screen. Check out the GUI class in the docs for more information.
Thanks alot Higgyb. This is what i want. The script is understandable and yet i do until so complicated. Really thanks.