Search Unity

Huge lag spike on first touch due to Event System?

Discussion in 'UGUI & TextMesh Pro' started by ArchangelG, Jun 10, 2017.

  1. ArchangelG

    ArchangelG

    Joined:
    Dec 14, 2016
    Posts:
    1
    Hello! First time posting here, and unfortunately its due to a big problem we are having with our game.

    We are basically doing a 3D third-person shooter, and things were running smoothly so far... except for one problem.

    The game is a bit complex, so the HUD has many buttons - weapons, consumables, inventory slots, etc. They are all organized on a single canvas with a Graphic Raycaster. When i touch any button of the canvas for the first time, no matter what is the button, i get a huge lag spike, which wont happen again for the rest of the scene.

    I did some tests by removing some Event Triggers, deactivating some HUD elements, etc, but the lag spike still happens even when we have only three buttons on the Canvas as soon as we touch any of the three.

    Here is a profiler screenshot of a test we made with the full canvas, all objects working, where its possible to see how much the EventSystem.Update affected the FPS. Here is a second test, where we only had three buttons active on the canvas. The other HUD elements were completely removed from the scene.

    I've search through the forum but none of the solutions i've found worked so far. Anyone knows a way to reduce this lag spike?
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,297
  3. Geads

    Geads

    Joined:
    Aug 24, 2017
    Posts:
    45
    Bumb, 1st event system touch causes lag and GC alloc. Still a problem in 2018, simple 2d project does this
     
  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,297
    Please file a bug report.
     
  5. kobyle

    kobyle

    Joined:
    Feb 23, 2015
    Posts:
    92
    Did you manage to solve it?
     
  6. GKiernozek

    GKiernozek

    Joined:
    Nov 16, 2013
    Posts:
    39
    any updates? :p
     
  7. denizluleci

    denizluleci

    Joined:
    May 30, 2016
    Posts:
    7
    Hello, I still have this issue in the latest version. Any updates?
     
  8. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,297
    Any bug reports?
     
  9. roointan

    roointan

    Joined:
    Jan 8, 2018
    Posts:
    78