- Home /
Strange bug in Unity 5 web build
A piece of code is simply not performed in my game. After upgrading to Unity 5 I noticed that the wheels of my car disappeared. Wheel class creates a looped chain of physics 2d circles to imitate soft wheel, and the function which connects 2 gameobjects by constraint is not performed for some reason. To avoid posting a lot of original code, I'll post a simple example:
// Wheel Class
void Start(){
// some code
Log("1");
MyCusmomFunction(param1, param2);
Log("2");
}
void MyCustomFunction(GameObject param1, GameObject param2){
Log("3");
// some code
}
In this example, everything after Log("1"); is not performed. I see only "1" in my output. This happens only when building for web player, iOS and Android versions work fine. When running in Unity IDE, there are no problems as well. There was no such bug in Unity 4.6.3.
What does the Log(string) method do? are you using :
System.IO.File.something
somewhere deeper in that call? because as i recall webplayer really does not like that and you need to get that out of the way at compile time with compiler directives
No, Log(string) adds string to an instance variable which is displayed on the screen by OnGUI function. There are no issues in Log method. $$anonymous$$oreover, if I take the code from $$anonymous$$yCustomFunction and replace $$anonymous$$yCustomFunction call with this code, this class starts working fine, but this bug appears in another class in absolutely random place!
Line 6 has a typo:
$$anonymous$$yCusmomFunction(param1, param2);
Should be:
$$anonymous$$yCustomFunction(param1, param2);
Answer by claytoncurmi · Apr 08, 2015 at 03:11 PM
Do you have any errors showing up in the console (ensure that the Warning and Error toggle buttons are On). From the code you posted, you are typing MyCusmomFunction and not MyCustomFunction. Really and truly it should not even compile.
Your answer

Follow this Question
Related Questions
Why can't I build Web Player in Unity while I have no problems with building standalone versions? 2 Answers
No realtime shadows in webplayer build? 0 Answers
Unity 5.0.2 WebPlayer : JavaScript - Failed to initialize the content 1 Answer
Red Crucible Reloaded Missing textures glitch 0 Answers
Unity workspace get black when start the unity or minimize . 0 Answers