Solution for strange jitter in simple code?
So i was coding the jumping for my character in a game im trying to make, and just when I got everything running the way I wanted it to I noticed a very strange jittering in the movment of my character while jumping. So I made a simple test of what is essentially happening in my actual code and the result is the same.
I have no idea why this would be happening. But I have so far been able to replicate it using a while function with a yield statement to wait one frame until the next calculation is done. The effect is present using all kinds of vsync, in both fixed and regular update. There really isnt anything that should cause this effect. I really have no clue. Please help me.
(edit: I just noticed that pausing the runtime, and skipping ahead frame by frame, produces the smooth result that is expected, however, unpausing makes everything jitter again. This is insanity.)
Here is a screenshot of the only code used in this test.
I beg for someone to give a reasonable explanation or solution for this. Before I go completely insane at EVERYTHING unity is constantly throwing in my way making everything I want to do a fucking battlefield of debugging and using shady workarounds to achieve the most simple of tasks.
Your answer
![](https://koobas.hobune.stream/wayback/20220612074126im_/https://answers.unity.com/themes/thub/images/avi.jpg)