- Home /
micro Jittering, stuttering... bug of unity?
ok now I am sure that nothing of my game does these stuttering or lagging of the moving camera. I really think it must be a problem or bug of unity...
I use the latest unity version.
the problem is if I move my camera ingame via script or character controller or rigidbodyFPSScript then randomly these stutters/lags happens.
it looks like that 1 frame is missing or that the camera moved on this frame too far.
I found many threads on the internet of people having that problems or better some people talking about this problem of already finished unity games like kerbal space program....
I tryed it with DX11, DX10, Shadermodel simulated 2&3, VSync off/1/2, I removed every script in scene exept the camera ping pong script that moves the camera from point a to point b and backwards... I wrote the script with a Coroutine, with fixedUpdate, Update and LateUpdate... with the LateUpdate it seems to move the camera smoother but these little lags are then more visible...
I removed all exept only a bunch of planes with lightmaps and 3 lights and a skybox on the camera. with VSync off I have 2000 - 3000 frames per second then it looks a bit smoother but still these little lags are noticeable.
here is a link to my ladderTest Build where I noticed these stutters. its a zip with the exe inside so you can try for yourselfe. ladderTestBuild
walk left right because then you can see the lags more obviously. with ESC you can in the menu turn VSync off if you want. !!!dont minimize the game if you play in Fullscreen because Unity has still the bug where you cannot maximize the game or end it. if that happen open the task manager and go with your arrow keys to the game and end it.
Sorry, but i can't test your sample, since it's a 64bit build and i still have a 32 bit system ;)
Anyways... In general using FixedUpdate will always cause jitter as FixedUpdate runs at a different interval as the visual update. Same for anything physics related (FixedUpdate is actually run by the internal physics catch-up loop).
LateUpdate and Update actually should be quire similar except it's movement is based on another scripts Update as this would be a dependency-chain and you would have to specify the order in which the Update routine should be called. LateUpdate usually solves such problems since it is called after all Updates.
It's not a "bug" in Unity. The FixedUpdate jitter is a known and expected behaviour due to the "fixed" update.
If you see jitter when using LateUpdate, that jitter comes from sources outside Unity, most likely the OS or other software that runs in parallel. Things like that could cause framerate fluctuations which you might notice as jitter.
ok... so I tryed to deactivate all background software I can think of and I got the still the jitters....
soo what you say is that these jitters are totally normal and everyone else has these jitters that uses unity?
I have unity pro and in the profiler I can see spikes there but they are so regulary and are not in the same frequency as these lags...
I never noticed these jitters on my windows 7 pc... a month back I moved to my new windows 8 pc.... could that have something to do with my problem? I will later today make a bake of this testlevel for 32 systems. would be nice if you could have a look at this level.
here is the link to the x86 build. ladderTestBuildx86
I played now around in the x86 version and it seems that there are less of these jumpy lags.... actually they are hard to see in the x86 build.
these spikes are the WaitForTargetFPS when VSync aktivated. if I press ESC and disable VSync then I have only spykes if I press a movement button and there is then GFX.WaitForPresent----Total = 88.1%----Time ms = 10.34
I need to go sorry I be back later this day.
O$$anonymous$$ it's probably not relevant to you, but its relevant to the thread.
$$anonymous$$ost people create jitter through the way they move the camera. its angled downward so moving forward moves it downwards too. $$anonymous$$ost people add in a height adjustment.
If the Lerp steps are beco$$anonymous$$g too large, i.e there is simply too much distance being covered per frame, this will become hugely prevalent.
As the character could be varying in speed, the jitters will also be very inconsistent.
Answer by TruffelsAndOranges · Jul 12, 2015 at 09:26 AM
I also have this stuttering. It doesn't really matter if the scene is complex or simple (1000 FPS or 60 FPS doesn't matter), the stuttering seems to be built-in somewhere deep in the Unity engine, and is not noticeable in the profiler!
I can have much more complexity in say the Unreal Engine and have no stuttering at all. And no, I'm not using FixedUpdate for anything; I'm setting velocity of rigidbodies and then use LateUpdate for camera movement. And for that matter; even if my camera is stationary without any camera movement script there will still be stuttering just as Harry64 describes.
So basically, this problem might be hardware specific but it doesn't seem to be. I'm on a 970 GTX and a 2500K, Windows 7 64bit and 16GB RAM.
Answer by gsus725 · Aug 28, 2017 at 05:11 AM
You can make an empty scene and move a cube using any code you like, it will still stutter. It's a problem of Unity but most people don't have good enough vision to see it but for me it is extremely awful.