- Home /
Stuttering web player
I was trying the webplayer and found there's some stutering every now and then, so to check up, i made a minimal scene with a scrolling camera and limited the webplayer to 60 fps as you can see here.
Basically the camera code is this. and the fps counter from the wiki.
void Awake ()
{
Application.targetFrameRate = 60;
SetPixelResolution ();
}
void LateUpdate ()
{
if (transform.position.x < 300) {
direction = 1;
} else if (transform.position.x > 1300) {
direction = -1;
}
transform.Translate(direction * 100 * Time.deltaTime,0,0);
}
Am i missing something? It runs like butter on all standalone versions.
Using dropbox is very bad for performance. This system is not intended to perform like a web server.
It may be bad if you stream the assets but for that they're already loaded + it does the same on localhost. Anyway a copy on my server: http://soft10.es/wp-content/test3/test3.html
dropbox does not affect performance what so ever. also i saw no lag at all and received 75fps the entire time.
ya that's what i thought you said in the original post. quite odd.
Answer by Kryptos · Aug 28, 2012 at 01:42 PM
Looks like some loading issue (it does not lag after the first translation). Do you use Resources.Load anywhere in your scripts?
It is better to load everything at the start of the level, to prevent loading lag.
edit: in fact it happens along with the display of Unity watermark. Try to wait for 1 or 2 seconds before starting the translation (the amount of time needed to mask the watermark).
Nah i try to be as garbage collector friendly as possible, plus that thing only has the guitext, mesh and camera with at script ( well theres that set pixel size but thats just to setup the ortho cam on start)
To give a bit of background this was the original project where i found it stuttering http://dl.dropbox.com/u/69084784/foney/pixeltalk/pixeltalk.html , it keeps doing it constantly ( i get it constantly on the $$anonymous$$i demo too), and since i wasnt sure what was causing it i made a clean project with just the map.
The strange thing is that if i run it in fullscreen except from some vsync issues it moves smoothly. All i can think its some kind of issue with the player+browser
Update Fixed the link. (Stupid ipad dropbox)
Your answer
Follow this Question
Related Questions
Are there any performance differences between a timer and using Invoke? 1 Answer
Reasonable heap alloc. per second and total ? 0 Answers
Sprite Alpha Performance 0 Answers
Performance difference between webPlayer and Flash? 0 Answers
Why can't I build Web Player in Unity while I have no problems with building standalone versions? 2 Answers