SEHException on collision.gameObject.tag

Unity 5.1.1f1
Windows Store export Phone 8.1
Visual Studio Community Edition 2013 Update 5 RC
Exception thrown in both debug and master mode.
Works fine in editor but throws exception in OnCollisionEnter(Collision collision) function when accessing the tag of the collider i.e. if (collision.gameObject.tag.StartsWith(“Obstacle”))

at UnityEngineProxy.InternalCalls.GameObject_Get_Custom_PropTag(Object self)
at UnityEngine.GameObject.get_tag()
at PlayerController.OnCollisionEnter(Collision col)
at PlayerController.$Invoke7(Int64 instance, Int64* args)
at UnityEngine.Internal.$MethodUtility.InvokeMethod(Int64 instance, Int64* args, IntPtr method)

Not enough information here… Check if collision.gameObject or collision.gameObject.tag is not null.

If that doesn’t help, please submit a bug with small repro attached.

Its not null, that’s why it runs in the editor :slight_smile:

This issue is now resolved.

For unknown reason the tags went missing from the Project Settings → Tag List. Even though they were still assigned to the game objects. Adding the tags back to the Tag list resolved the issue.

Looks like the editor doesn’t care about tag list and treats gameObject.tag as a string literal thats why it works in editor.