Closed stanleyjoy closed 11 years ago
It sounds like you are tyring to call CompareTag on a component that has been destroyed. Are you doing it on a cached component reference? Checking for null is a valid method of preventing a crash though.
I was not using the compare tag at all. you can try it if you want. if it means anything the Tag that it always tries to compare is the Main Camera. Stan
Got a funky bug...
When I was jumping between scenes, the game crashes. [Menu -> Game -> Menu -> (Crash)]
It is pointing a Null Reference error to Compare Tag method in the Component.cs
Check Code
Component.cs
region Public methods
endregion
While debugging the return boolean of that method is a null at the point of crash.
The solution. I think the Component.cs is called or compiled before the GameObject.cs which causes the null reference issue. All we need to do is to check if gameObject is not null
Component.cs
region Public methods
Using the if condition solves this issue. All though still no idea whether we would have any side effects.
Stan
If any please Post em.