- Home /
Performance issue with ScrollRect.LateUpdate()
Hi guys, in my Android game there's an evident lag when I tap a button to open a scrollable list of prefabs. I have two ScrollRects that can be open separately, the one that should be less memory-costing has 8 prefabs in it, each prefab having 2 images and 3 texts.
I used the profiler and found out there's a lag spike. Here's an image: link.
ScrollRect.LateUpdate() takes 629.70 ms to execute when I open the scrollable panel. There's a spike when I try the game on PC, too, but it's only about 50 ms. If I close and re-open the ScrollRect it doesn't lag like this again.
Do you know what I might do to reduce this lag?
If you are instantaing the prefabs on first execute, then it can cause the problem. Try to pool them first. I mean load it in Start() method.
Answer by Cress7 · Jun 09, 2016 at 02:36 PM
Done as Masterio said.
Instantiate prefabs in a loading screen reduced the time to open the Scroll View.
Your answer
Follow this Question
Related Questions
UI performance on mobile. FPS drops 0 Answers
Scroll Rect with Grid Layout not working properly. 2 Answers
Make an snapped ScrollView 2 Answers
CanvasRenderer.OnTransformChanged lag on enabling/disabling Canvas component on Android 0 Answers
Can't use horizontal layout with ScrollRect scrollview in Unity 5.3.3f1 1 Answer