Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question webGL build lag issue

Discussion in 'Web' started by oguzbeyaz06, Oct 30, 2022.

  1. oguzbeyaz06

    oguzbeyaz06

    Joined:
    Jan 21, 2020
    Posts:
    2
    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
    2022-10-30-17-51-02_UwJURhiL.gif



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

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,127
    Share the script controlling the camera.
    I assume the counter is fps
     
    oguzbeyaz06 likes this.
  3. oguzbeyaz06

    oguzbeyaz06

    Joined:
    Jan 21, 2020
    Posts:
    2
    yes it is the FPS counter, i am using cinemachine.

    also this character movement
     
  4. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,127
    Maybe log the values you put in to see what they are and if they are concistent
     
  5. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    6,422
    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.
     
    DevDunk likes this.