webGL build lag issue

Hello everyone, I have a car racing game. Unity also runs without getting stuck, but when I get the webgl build, the game laggy. How can i solve this problem.

lag when i get this webgl build
8550056--1143176--2022-10-30-17-51-02_UwJURhiL.gif

this is the image when I run it in unity, there is no lag.
8550056--1143170--2022-10-30-17-53-42_CSLOBfLM.gif

Share the script controlling the camera.
I assume the counter is fps

1 Like

yes it is the FPS counter, i am using cinemachine.

also this character movement

Maybe log the values you put in to see what they are and if they are concistent

This isn’t lag, it’s jitter. It looks like multiple conflicting transform changes issued at the same time. Are there maybe multiple cameras or camera movement scripts active at the same time?

It is hard to make out but I think I see some jitter even in the editor animation, it may simply not as pronounced due to the higher framerate.

1 Like