- Home /
Simple 2d Rigidbody + Force = Choppy Stuttering Ball
Hey everyone. We are having animation stuttering issues with Unity. We had the issues with Unity 4 and now 4.1. It is an incredibly simple breakout game that we are building based on a tutorial.
We have Googled around and see a lot of complaints about the stuttering issue and have applied the suggested fixes without any success.
You can see the game here on the web:
http://www.strigopstudios.com/bricksweb
We have tried: VSync Settings - no help Interpolation - no help Angular drag - no help Adjusting ball speed - slower seems to help a bit We tested on PC, Mac, and Web Player with the same results
We stripped down the code to barebones. The ONLY code in the entire program is on the ball and it is the initial push rigidbody.AddForce (100f, 700f, 0); on Start().
We created a particle generator which generated 10,000 particles at a time, and had no lag. I don't believe this is lag, it just looks choppy. This is not a hardware issue.
The issue is described here by another poster:
http://answers.unity3d.com/questions/299204/2d-jerky-motion-with-addforce-and-physics.html
Seems kinda of strange that Unity can push a huge number of smooth particle animations but cannot move a single object smoothly.
Any thoughts? Any help is greatly appreciated, nobody seems to be answering this question on goggle. Thanks!
EDIT: Reuploaded with a different background as requested by Olgo
http://www.strigopstudios.com/bricksweb2
The problem is most noticeable when the ball is traveling at an extreme angle, watch for about 30 seconds, I still see it, but maybe it's an optical illusion. All help appreciated, thanks everyone for comments so far and for future help!
Looks totally fine to me, have you tried this on different computers? I'm running a Dell laptop with an i7 and chrome browser. I dont see any issue with the smoothness of the ball.
I have tried it on several computers. Is it maybe an optical illusion? I find the longer that I stare at it the more I notice some choppiness. $$anonymous$$aybe I am going crazy...
Do not post responses to comments as answers to questions! ALso can you describe the choppiness in more depth?
ditto here for not choppy. Looks fine to me
I use ATI boards though
Answer by Strigop · Mar 24, 2013 at 05:45 PM
OK so after reading everyone's responses and tweaking settings and trying new things, we have come to the conclusion that a lot of responses are correct. We believe this to be an optical illusion, and we found a very simple way to demonstrate the effects of the optical illusion and then how to minimize the effect.
Example (Choppiness Optical Illusion Effect):
The two links below demonstrate the optical illusion. Watch the ball carefully and you will notice that the ball seems to teleport / skip / or appear choopy
http://www.strigopstudios.com/bricksweb/
http://www.strigopstudios.com/bricksweb2/
My belief is that this illusion is because you are trying to follow the only moving object in the scene with your eyes and your eyes can't keep up (as stated by some comments above). Also you notice every minor twitch in the ball. This effect can be minimized / removed completely with the following demonstration
Example 2 (Smooth movement - same code, same objects, but now with more balls (heh) ):
http://www.strigopstudios.com/bricksweb3/
Notice now that with more distractions and more movement, the movement seems smoother and has no choppiness effect. You can recreate this effect by picking 1 single ball, and trying to follow it with your eyes. The effect is still less though than the other 2 examples because there are other objects moving which cause a distraction. This is my theory along with some other users who responded above. Thank you everyone for your quick help and assistance, and hopefully this thread will help others searching for a similar issue.
In summary: The ball does appear choppy when alone, so it is actually an issue that should be addressed by the game developer. Adding other objects that move or other animations help create the illusion of smooth movement and immerse the player in a better gameplay experience.
This should be marked as corrected and stickied forever. I don't know that I've ever seen the 'stuttering movement' question answered satisfactorily before!
Thanks! I am glad to hear that this could help others. Thank you everyone for your responses and for helping us figure this issue out. How do I mark it as corrected?
Oh, sorry, as "answered". The little check mark by the answer, below the thumbs-up, number, thumbs-down icons. Stickying isn't a thing that exists on Answers, but if it did, I'd sticky this. :)
Answer by stuatk · Nov 26, 2013 at 02:20 PM
oh dear.
Try turning Interpolate on in the rigidbody2d component in the inspector.
there is a dropdown list next to the label Interpolate. By default its set to none. Change it to interpolate.
the optical illusion is the exact opposite - you notice the fact that interpolate has not been set the fewer objects there are in the scene.
Your answer
Follow this Question
Related Questions
Lighting is making my scene look crazy/spikey/broken. 2 Answers
A better way to do jumping? 2 Answers
choppy editor with inspector visible 1 Answer
Unsmooth vehicle-following camera 1 Answer
2D Collision Avoidance & Smoothly rotating game object 1 Answer