Hello everyone! I am having a little trouble getting smooth movement for my GameObjects. I am currently testing with simple sriangle sprites and a gray background, so nothing too fancy. The triangle would move smoothly for a bit, but every now and then do a little jerk forward. Sometimes it is hardly noticable, and at other times it is. I want to eliminate the possibility that I am doing something obviously wrong, so I would really appreciate any tips or ideas, why this might be happening. Some more details about my test: WebGL build It is a 2D scene, I use Vector2 for all the movement code The mouse click detection (for the new target position) as well as the movement itself happen in Update() I use Vector2.MoveTowards(transform.position, target, speed * Time.deltaTime) to determine the new position for this frame I have also tried with Vector2.Lerp(), and what I found in a blog post: How to Lerp like a pro, but the problem remains (although harder to notice with Lerp). Any hints and pointers in the right direction would be greatly appreciated! Thanks in advance and best regards, Patrick
In a small project with very few objects, there are not too many ways to get it wrong. If few objects run smoothly in a native windows/macOS app, it should run smooth on the web. Are you running a Release build?
Hello @jukka_j! I was running a development build. What seemed to help was putting the actual movement in a coroutine (which made working with Lerp() easier anyways). Thanks for your response, it seems to work fine with the coroutine approach. Best regards, Patrick