Talk:Bugs in the Unity programming environment

From Unify Community Wiki
Jump to: navigation, search

Hi, i just found this page and the do-while bug really seems to be a bug, but I*ve never heared of the "print" problem. What does even "fail" mean? No log at all? An compile error? A runtime error? Crash? How do you know that Debug.Log works in a case where print "fails" when you can't address the case?

print() is actually just a static function of the MonoBehaviour class that wraps Debug.Log. So there's no real reason why it should / could fail. print is of course only available in classes that are derived from MonoBehaviour. In other classes you have to write MonoBehaviour.print(). There's actually no reason to use print at all. It should just "shorten" the function-name when used in a MonoBehaviour.

    // C# (original code decompiled from UnityEngine.dll)
    public static void print(object message)

--Bunny83 (talk) 23:47, 11 January 2013 (CET)

I've gotten bugs where there is no compile-time error, but a Debug.Log() works while a print produces no output. This is as of Unity 3. Ppeterson (talk) 17:51, 24 February 2013 (CET)
Personal tools