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:
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.
divillysausages.com is the site of Damian Connolly, an Irish (game) developer currently living in Bordeaux, France. Languages include AS3, C#, JavaScript, TypeScript, ObjC, C++, Groovy, Dart, Flutter and any other buzzword that currently floats his...
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.
In my case, it was a call to DateTime.Now somewhere deep in the methods that was slow!
take a look at this:
I replaced the code with Time.time and it’s fixed now.