Okay, I thought I’d ask a question about this before I lose all my hair and put my fist through the computer screen!
I have a project that is designed to run in the WebPlayer. It runs fine in the Editor, the problem only rears its head after the project is built and running in the WebPlayer.
It has a single scene. When the task is completed, the user clicks the Reset button and the scene is reloaded to try again.
The problem is, part of completing the scene is a script on one game object calls a function on another game object. It was a coroutine, but I’ve simplified it down to a test function and am still getting the error.
First time through, all works fine - the test function is called on Script B by Script A without any hitches. Once the scene is reloaded, however, Script A doesn’t seem to be making the call. Because it’s running in the WebPlayer, I have no verbose debug logs and the problem doesn’t happen in the Editor.
I’ve tried starting a coroutine, calling a straight function, even broadcasting a message to Script A, but nothing is working (there is no error message, but no message produced by Script A to show it’s been called either.) I’ve also tried creating another script variable and linking it to Script A at runtime using FindObjectWithTag and GetComponent, and this is still doing nothing as well.
Bare in mind that the function I’m calling on Script A does nothing except print a message to the screen, and it works perfectly in Editor and in the first run-through of the scene in the WebPlayer - it’s only after the scene is reloaded that this happens.
I have no persistent objects that affect either script.
I’m using Unity 4.6. Is this a bug in the new build?