- Home /
hiccup and stuttering
Hello I know these questions have already been but I just want to renew the subject. Maybe there is already a new solution. I 2 weeks look for and answer. I tried everything. I created easy 2d scene whene camera follow game object and still there are hiccups when play. I tried:
no rigidbody
rigidbody2D interpolate, extrapolate, none
character controler
fixed update, late update, update
deltatime, smoothdeltatime, no deltatime
vsync - all settings
fixed Timestep
Aplication.targetFrameRate = 30,60,300,700,200,-1
Lerp, slerp, Transform.translate, Rigidbody.AddForce
camera perpective in scene 3D (obiects as Rigidbody3D)
camera ortographic in scene 2D (obiect as Rigidbody2D)
openGL3 and openGL2
DynamicBatching on off
Is there any solution? When I browse google Play store many games from Unity has hiccups. Sometimes so large that unacceptable.
Is it a problem of Unity? Is it already is there any solutions? In the shop there are game play that do not have the hiccups when moving the camera. So it is possible to solve. But Unity can deal with it?
Answer by Darioszka · Apr 15, 2015 at 02:29 PM
I tried several ways. 1. When the camera follows the subject:
void LateUpdate () {
myCamera.transform.position = Vector3.Lerp(myCamera.transform.position , target.position + new Vector3 (0f, 0f, -14f), 9.0f * Time.smoothDeltaTime);
}
Used options: FixedUpdate with Time.fixedDeltaTime - the worst effect; Update with Time.DeltaTime - worse than LateUpdate; lerp and slerp - no difference
2). I removed the script in which the camera follows the subject and connected the camera to an object, the object - a parent, the camera - the child and tried to move the object:
FixedUpdate ()
{
rb.AddForce(transform.right*0.5f);
}
or
void Update ()
{
MovePosition(transform.position + transform.right * Time.DeltaTime);
}
or
void Update()
{
transform.Translate(Vector3.right * 0.02f);
}
For all of course I combined with the option rigidbody (different settings) and without rigidbody.
On one of the forum could read that problem is in moving objects as a function Update (). So for the test I done to move an object in IEnumerator:
IEnumerator Example ()
{
yield return new WaitForSeconds (0.0001f);
transform.Translate (Vector3.right * 0.02f);
StartCoroutine ("Example");
}
All these scripts are simple ways to move the object in a given direction. In the scene there are no more scripts. In the scene there are still boxes (in 3D) and sprites (2D) as background objects. Simple scene. This is not just my problem. I found a lot of forum with the same question but no solution anywhere.
Answer by Raimi · Jun 15, 2017 at 04:58 PM
I'm currently having the same issue on android. Setting the Quality to fastest helps a little bit. but still seeing this effect. It is much worse on my Samsung galaxy tab 4 than my htc one phone.
I read somewhere that it could be caused by garbage collection happening every few seconds, but yet to do more investigations.
Im using unity free so cant use the profiler?
Edit: You can use profiler on free version now. Yay! (should of actually checked it lmao)
I think the unity player is very resource hungry, so it might be something we just have to deal with using unity.
Just checked profiler and im getting huge spikes in rendering every few seconds, and its showing quite a few draw calls. I use One sprite sheet for all images and I also pool objects, so shouldn't be so many draw calls. Still digging into it. Hope this helps, even if just a lil bit :)