GameObject.Find no longer working for specific classes

Hi all, I’m at my wits end. Don’t expect an answer but just in case someone else has had this experience…

I’m an experienced Unity coder. My project makes use of GameObject.Find (in C#) – not a big surprise there. It worked fine until yesterday afternoon.

Then, I built a prototype version for the Web Player so my client could view it. I came back after a half hour break, made a small code change (added a single class and attached it to an object), and when I ran it, I had about a dozen NullReferenceException errors.

At first I thought it was the component scripts that had somehow gotten unattached to their objects. But I have narrowed it down to two scripts where GameObject.Find is failing to find an object that every other script in the project is Find’ing without a problem.

I won’t post code because there’s nothing to post, just a few GameObject.Find’s in different classes.

Anyone else had this experience after building for the Web Player? I am totally baffled.

GameObject.Find does not find classes, it finds objects by name. Maybe you meant Unity - Scripting API: Object.FindObjectsOfType ?

Also make sure the objects are active (no scripts turning them off?) Find won’t find inactive objects.