Community
cancel
Showing results for 
Search instead for 
Did you mean: 
MartyG
Honored Contributor III
102 Views

Unity 5.3.4 and Unity 5.4 Beta now available / fixing an error generated by 5.4

Hi everyone,

Unity has released two new versions - a 5.3.4 Final version and a 5.4 Beta version which is said by Unity to contain major new enhancements for areas such as VR performance, workflow and graphics rendering.

http://blogs.unity3d.com/2016/03/15/enhanced-visuals-better-performance-and-more-the-unity-5-4-publi...

I installed the 5.4 beta and tested it with my Unity RealSense project.  Once Unity updated the project files, I had a red error message generated multiple times by the TrackingAction and SendMessageAction SDK scripts..

*********

EnsureRunningOnMainThread is not allowed to be called from a MonoBehaviour constructor, call it in Awake or Start instead. Called from script 'TrackingAction' on game object.  See "Script Serialization" page in the Unity Manual for further details.  UnityEngine.Object:GetInstanceID()

BaseAction:.ctor() (at Assets/RSUnityToolkit/Internals/Actions Utils/BaseAction.cs:62)
VirtualWorldBoxAction:.ctor()
TrackingAction:.ctor()

*********

 

It does not seem to stop a RealSense project from working, but you annoyingly get the red errors generated in the console every time you run the project.  

Following the clue in the error message to check line 62 of the BaseAction script (which provides variables for scripts such as TrackingAction), I found that deleting lines 58 to 68 removes the red errors and makes the RealSense project work perfectly again in Unity 5.4.

1.jpg

The Unity error message stated that the error was related to "serialization".  And a comment in the BaseAction code says that the deleted code is related to serialization.  So that definitely seems to be where the problem is sourced.

0 Kudos
1 Reply
MartyG
Honored Contributor III
102 Views

I also found that Unity 5.4 beta generates yellow warning messages in the console about Blackberry and Web Player no longer being supported.  So fix this, search in the Asset panel's search box for the script file 'CrossPlatformInputInitialize' (just searching for 'crossplatform' will be enough to locate it).  Open it in the Unity script editor and delete the lines that make reference to Blackberry and Web Player and the yellow warnings will disappear.

Reply