Unity DoTween Lags the first time i press a button (to scale and rotate an UI gameobject), why?

524 views Asked by At

the first time I press a button UI (it calls a method that DoTween scale and DoTween rotate the button itself) it lags for half a second.

Just the first time I press it.

Why?

I tried to call DoTween.Init() in the main class, before any DoTween.. but it still lag (only the first time I press the button).

Edit: Probably is a EventSystem initialization thing, how can i solve it?

The first time i press a button.. there is a lag, as shown in the image. I see that is the "Blue" part (the code) that spikes, and in the details i see that the StandAloneInputModule and the EventSystem are the cause of it.

It happens only on Android, when in the editor does not happen.

What is the solution to remove this horrible lag the first time?

enter image description here

0

There are 0 answers