- Home /
Print String
i'm Trying to make a value print. I have my console set up, the script is assigned to an object in the game. But nothing happens.
var newVariable :int;
function start(){
newVariable = 2+6;
print(newVariable);
}
function Update () {
}
Any reason for that ? Maybe something in print.
You asked this on the Unity forums and got an answer there. Please don't cross-post for no reason.
Answer by syclamoth · Oct 25, 2011 at 10:19 PM
Basically, you need to spell 'Start' with a Capital S.
function Start()
{
// Debug.Log is a nicer way of getting print statements, as PaxNemesis says.
Debug.Log("Bluh bluh");
}
Is it possible to show a string in game without any gui.Text.text ?
In other words just displaying a int or string in game without GUI's.
Sorry for the late post.
Answer by Umbra · Oct 25, 2011 at 08:25 PM
It's not called Start() anymore, it's called Awake().
Awake and Start are two different functions called at different times; http://forum.unity3d.com/threads/2606-Docs-on-calling-order-in-$$anonymous$$onoBehaviour
Oh? I didn't know that, I'm sorry. Disregard my answer, then.
Answer by PaxNemesis · Oct 25, 2011 at 08:11 PM
You might want to try out the Debug class
newVariable = 2+6;
Debug.Log (newVariable);
Your answer
Follow this Question
Related Questions
Sending a string via email from Unity? 2 Answers
How do you display a saved name on the screen? 2 Answers
How can i split a string[] ? 1 Answer
A node in a childnode? 1 Answer
Return a string not Working in Unity 2 Answers