- Home /
Unity Web Player - Error when loading for the first time
Hey,
I've recently started developing with Unity and have run into an issue.
I built the game that I'm working on for the Unity Web Player; when I first try to play the game in my browser I see the Unity loading bar as normal but when loading is finished the web player screen starts flashing vey fast and sometimes shows pieces of graphics from other parts of the screen while flashing (it looks as though something goes wrong with the video memory), sometimes it shows pieces of graphics that were on screen fairly recently but not anymore. You can tell that the game is playing as it should because you can hear the sounds but you can't see anything apart from mad flashing. When I refresh the page everything works as it should. If I then leave it for a while and come back to it and load the page again the flashing will be back (until I refresh again). I have tried this on Safari, Chrome and Firefox and they all act the same. I have also tried on a different computer (although they were both running osx).
I have another game that I recently built that works perfectly well. I can't think of anything that I have done differently, they are both very simple games.
Does anyone have any idea what the problem could be caused by? I don't even know where to begin.
You can see my game here: http://joshua_burr.itch.io/swarm-attack (name suggestions very welcome), hopefully you will see the effect that I'm talking about (I tried opening the unity-built html file to play the game locally and have seen the same effect so it is nothing to do with itch).
Here are a couple of screenshots of the kind of stuff I see while it is flashing:
Thanks.
That is very strange! I Googled "upside down unity web player" real quick and found this thread: http://forum.unity3d.com/threads/webplayer-running-upside-down.53003/
Not sure if it's the same problem you are having, as this person was only having trouble on Windows and he removed any image effects he had.
I'm wondering if this could be a bug, however. Have you tried uploading it several times with the same results?
The screenshot makes it look as though the player is upside-down, it is actually madly flashing and that is one frame. I don't have any image effects on as far as I'm aware (are they only available in unity pro?).
I tried building it several times and I see the same effect when running it locally using the unity-built html file.
Thanks for the help.
If you look at the writing it is mirrored horizontally, so its not upside down...weird.
I have this exactly same problem. No matter which browser I use.
Answer by Joshdbb · Nov 16, 2014 at 12:42 AM
I have fixed this now. The problem was a script that I had on my camera:
void Awake()
{
Camera.main.orthographicSize = Screen.height / 200f;
}
Changing this to:
void Start()
{
Camera.main.orthographicSize = Screen.height / 200f;
}
fixed my problem.
I also noticed that you get the same effect if you build a scene with no camera.