- Home /
Insane EventSystem.Update lag spike, no graphic raycasters in scene
Hello!
I have this action: On screen touch: Activate a UI gameobject with text and NO graphic raycaster, deactivate a gameobject WITH graphic raycaster. That's it, however I'm still getting INSANE lag spikes for eventsystem, and I have no idea why.
Here's the profiler:
I am also having this issue no idea tried many things but unable to solved this problem. Please share how did u solved it.
Answer by OscarLeif · May 30, 2017 at 06:23 AM
It could be a lot of things, the most common is to have a lot of UI elements in the scene to the Event System have to check for all the UI elements.
For more informaiton please check here, it could help. https://divillysausages.com/2016/01/21/performance-tips-for-unity-2d-mobile/
Answer by IgorAherne · Jan 16, 2019 at 03:46 PM
Have a look here:
https://forum.unity.com/threads/event-system-performance-pretty-bad.292570/#post-4109506
Basically you have 49.3% shown as "Self", which is not much use. Use "Deep Profile" option, so it records a deeper callstack.
Answer by roointan · Feb 16, 2020 at 12:10 PM
In my case, it was a call to DateTime.Now somewhere deep in the methods that was slow! take a look at this: https://issuetracker.unity3d.com/issues/ios-il2cpp-system-dot-datetime-dot-now-is-slow-on-the-first-run I replaced the code with Time.time and it's fixed now.
Your answer
Follow this Question
Related Questions
Why is UI taking this much performance and how to reduce it? 1 Answer
EventSystem.current.IsPointerOverGameObject Issues with Mobile 0 Answers
EventSystem.IsPointerOverGameObject doesn't work on virtual joystick (mobile) 0 Answers
fps goes down when moving the camera 1 Answer
Is it possible to make a Unity mobile app appear under the Lock Screen, like the phone app? 0 Answers