Software Archive
Read-only legacy content
17061 Discussions

A list of yellow errors generated by Unity 5 (including RealSense Unity Toolkit errors)

MartyG
Honored Contributor III
727 Views

Hi everyone,

If you have experienced moments of object movement lag in your Unity RealSense project since using Unity 5, it may be because of yellow (non-fatal) errors that are being generated in the background of your application.  Some of these errors occur repeatedly on loop because Unity keeps checking conditions and finding that they are still broken since the last time it checked some seconds earlier.

Below is a list of 9 unique yellow errors that appeared in Unity's debug console within the space of 30 seconds of testing (there were actually 31 errors in that period, as some of them looped).  I have placed the errors related to the RealSense Unity Toolkit at the top of the list.  Some of the errors are also related to now-obsolete instructions in scripts that come packaged in Unity's own Standard Assets.

Regarding the Standard Assets scripts: it is the nature of Unity to check every script even if it is not used in an object.  So even if you are not using these assets in your project, Unity will be checking them and perhaps causing a momentary lag when the yellow error is generated.  

You may or may not have these scripts in your Assets panel, depending on whether or not you ticked the 'Standard Assets' box on the list of components to install when installing the latest version of Unity.  

Nevertheless, as the affected scripts seem to be in a standalone section of standard Assets (the "Utility" folder) and not tied to anything, you can probably eliminate those errors fastest by just deleting those scripts completely so that Unity does not throw up errors when checking them.  I would make sure you have a complete backup of your Unity project folder before doing so though, just to be on the safe side!

The RealSense ones are mostly easy to fix, as it just involves opening the affected script in your Unity script editor and removing the reference to the variable that is not used.

EDIT: I deleted the 'Utility' , 'Character Controllers' and 'CrossPlatformInput' folders of scripts from the Standard Assets directory completely, as I only needed the 'Environment' folder of the Standard Assets for the tree models and water from it that I use in my game environment..  The errors related to those scripts disappeared and there were no ill effects on my RealSense project.

*********

REALSENSE UNITY TOOLKIT ERRORS

FaceTrackingRule

Assets/RSUnityToolkit/Internals/Rules/FaceTrackingRule.cs(181,41): warning CS0219: The variable `position' is assigned but its value is never used

 

BaseAction

Assets/RSUnityToolkit/Internals/Actions Utils/BaseAction.cs(49,24): warning CS0414: The private field `BaseAction._prefabCopyGameObject' is assigned but its value is never used

 

SenseToolkitManager

Assets/RSUnityToolkit/Internals/RealSenseInput/SenseToolkitManager.cs(109,30): warning CS0414: The private field `RSUnityToolkit.SenseToolkitManager._isInitBlob' is assigned but its value is never used

 

Bool3DDrawer

Assets/RSUnityToolkit/Internals/Editor/Bool3DDrawer.cs(24,34): warning CS0618: `UnityEditor.EditorGUIUtility.LookLikeControls()' is obsolete: `LookLikeControls and LookLikeInspector modes are deprecated. Use EditorGUIUtility.labelWidth and EditorGUIUtility.fieldWidth to control label and field widths.'

 

SenseToolkitAssetModificationProcessor

 

Assets/RSUnityToolkit/Internals/Editor/SenseToolkitAssetModificationProcessor.cs(90,56): warning CS0618: `UnityEngine.Object.FindSceneObjectsOfType(System.Type)' is obsolete: `use Object.FindObjectsOfType instead.'

 

STANDARD ASSETS

MobileControlRig

Assets/Standard Assets/CrossPlatformInput/Scripts/MobileControlRig.cs(40,61): warning CS0618: `UnityEngine.EventSystems.TouchInputModule' is obsolete: `TouchInputModule is no longer required as Touch input is now handled in StandaloneInputModule.'

 

ForceReset

 

Assets/Standard Assets/Utility/ForcedReset.cs(14,52): warning CS0618: `UnityEngine.Application.loadedLevelName' is obsolete: `Use SceneManager to determine what scenes have been loaded'

 

Assets/Standard Assets/Utility/ForcedReset.cs(14,25): warning CS0618: `UnityEngine.Application.LoadLevelAsync(string)' is obsolete: `Use SceneManager.LoadSceneAsync'

 

TimedObjectActivator

 

Assets/Standard Assets/Utility/TimedObjectActivator.cs(82,25): warning CS0618: `UnityEngine.Application.LoadLevel(int)' is obsolete: `Use SceneManager.LoadScene'

 

0 Kudos
1 Reply
MartyG
Honored Contributor III
727 Views

Here's the fixes for the RealSense Unity Toolkit errors where you have to do more than just delete a reference ot a variable.  It is important to make clear that if your RealSense application is a simple one then it may not be worth the trouble of doing these edits, as your application will run so fast that any lag generated by yellow errors might not even be noticable.  Lag negation becomes an issue mainly when you have a very large project such as a complex game with hundreds of assets, where you need to find optimizations wherever you can get them.

Also, if the Unity script editor asks you to convert the line endings of scripts, I recommend clicking "Ok", as the latest version of Unity seems to be much more fussy about this than earlier Unity 5 versions and can generate red errors resulting from what it perceives to be faulty script lineendings.

********

BaseActionEditor

At line 80, replace this line:

EditorGUIUtility.LookLikeInspector();

With this line:

EditorGUIUtility.labelWidth = 0;  EditorGUIUtility.fieldWidth = 0;

*******

There are also a number of scripts where the instruction EditorGUIUtility.LookLikeControls(); needs to be replaced with the line above to prevent yellow-errors being generated by them:.

 

SpeechCommandDrawer

Line 24

RotationConstraintsDrawer

Line 33

MinMax2DDrawer

Line 24

RotationMax2DDrawer

Line 24

ScaleConstraintsDrawer

Line 33

Transformation3DDrawer

Line 33

Bool3DDrawer

Line 33

******

Finally, the script SenseToolkitAssetModification should have this instruction  on Line 90:

GameObject.FindSceneObjectsOfType

Replaced with:

GameObject.FindObjectsOfType

I.e the word 'Scene' is removed from the instruction.

 

 

0 Kudos
Reply