Why does unity do this thing where it like… skips a frame (or lags for one frame) every couple of seconds even if the frame rate is is 40-50+? I looked at the profiler and it says that its the camera.render such and etc that is spiking every few seconds, but it has no reason to. Its just a basic scene: a terrain, and a camera. This annoys me because its a cut scene and like i said, has absolutely no reason to be skipping. There is basically nothing in the scene (and generally my comp wont go down below 20 fps even with a lot in the scene)
This happens in the editor?
The editor is horrible for me, skips all the time, but I never get it in the builds.
That sounds like the garbage collection problem which caused us to create PoolManager. The stutters stopped as soon as we stopped destroying instances so much.
This is very hard to duplicate reliably. I can only go off my own experience and many others who have reported the same issue. It is not a problem with Unity and it only happens after a combination of actions cause the stutter you are getting. Garbage collection is like a multi-level pyramid. The bottom level is for shot-lived items and gets cleared a lot. Things which stick around a bit longer get pushed up to the next level when a collection occurs. This gets repeated for the next level so that items in the third level don’t get collected as often if at all. It is a good system but it isn’t perfect. My theory is things get trapped in a higher level when they shouldn’t and the GC (garbage collector) hiccups when it cleans house. I can’t be sure, but I know it stopped when we started reusing instances instead of destroying them.
Yeah its happening in the editor, i haven’t built the level yet so i’m not sure about an exe or webplayer, but yeah, its happening in the editor.
Also, since you mentioned the builds, in my builds, some objects will like… shake. Like there’s this one wall that is made of about 3 segments, and if you rotate the camera, the objects kinda shake and you can see all the seams in the walls and stuff. I don’t think its on all of the objects, but i noticed it on that one wall (and no the walls segments are not overlapping).
I think i get what your saying, but like I said, there’s nothing really in the scene, just a camera, the terrain/road, some grass and a few trees (only one mesh tree) and a truck (and Depth of Field but if i turn that off it doesn’t make much of a difference).
…and now for the universal #1 question in IT support…(sorry it has to be done)… Did you reboot your computer? [/ducks]
Yeah i did, its been doing this for a long time.
No matter what, I get horrible performance when I play in editor. When I am testing things and need to get a good benchmark for where I’m at, I always build and run a standalone player.
Actually I have the same problem and it occurs also in a standalone build (it feels like exactly one second between peaks)
It might have something to do with skinned meshes(I have 20 animated Lerptz in my scene). Still have to clean up my project and create a bug report though…
That’s basically what mine is doing

