Bugs in the Unity programming environment

From Unify Community Wiki
Revision as of 11:20, 5 December 2012 by Ppeterson (Talk | contribs)

Jump to: navigation, search

These are some bugs in the Unity programming environment that I've reported to Unity but which haven't been fixed as of the last time I checked. Also included are some past bugs that were there in Unity 3.x but are fixed in Unity 4. Please feel free to update this list if you have evidence any bug has been fixed.

print() function works only intermittently

I do not know if this is bug occurs in Unity 4 due to its nature of being hard to reproduce. However, it was present in Unity 3.x.

I have not isolated the specific conditions that cause this bug, but in very few cases, the print() function/statement will simply fail to work. This happens in both UnityScript and Boo. To avoid this bug, you can instead use Debug.Log(), which does not seem to fail in any of the cases where print() fails.

do .. while loops work incorrectly

This bug has been fixed with Unity 4. However it is present in Unity 3.x.

This seems to be specific to UnityScript. The body of the do...while loop will be executed at least once, as it should, but then the body will be executed again until the condition (the "while" part) becomes true. Note that if it worked correctly, it would loop until the condition became false.

Here's a test case:

print("I can count to ten!");
var n : int = 0;
do {
} while (n < 10);

What should be produced is (line breaks omitted):

I can count to ten! 1 2 3 4 5 6 7 8 9 10

Instead what I get in Unity 3.x is:

I can count to ten! 1

Similarly, the following code produces an infinite loop when it should not. NOTE: Running this code will cause Unity to freeze and require a restart.

var n : int = 0;
do {
} while (false);

In reality it should print "1" and finish.

Personal tools