- Home /
How do I optimize the "Player Loop"?
I´ve read the documentation regarding Player Loop, but I don´t quite get it. It says:
"This class contains functions for interacting with the player loop in the core of Unity. You can use this class to get the update order of all native systems and set a custom order with new script entry points inserted."
What class is that? Where and how am I using it? I have big spikes in my profiler due to the PlayerLoop, but it doesn´t specify where is it or how to fix it.
Thanks
Answer by Nocktion · Feb 07, 2019 at 07:58 AM
The PlayerLoop is the "heart" of a Unity game. You can never access it since it's integrated into the UnityEngine. The profiler assigns everything inside your game under the PlayerLoop (and the Editors components under the EditorLoop). Therefore any spike "caused by" the PlayerLoop is actually caused by your own scripts,config, setup and things like that, including graphics too.
Answer by unity_murc134 · Jul 08, 2020 at 03:06 PM
That is not true, you can make a custom player loop since Unity 2018.
https://medium.com/@thebeardphantom/unity-2018-and-playerloop-5c46a12a677 https://docs.unity3d.com/ScriptReference/LowLevel.PlayerLoop.html
This is true, but the official support for those classes (according to the documentation) is first documented in Unity version 2019.3. It was available as an experimental feature in 2018
To be fair the question could have linked to the actual documentation he was reading. Just saying "the documentation says" is very unspecific.
Your answer
Follow this Question
Related Questions
Profiler PlayerLoop spikes with no apparent reason 1 Answer
low FPS when battery is low ( unity android ) 0 Answers
Very Bad Performance on Android 3 Answers
Scene Lag when first running a certain script, but then returns to normal performance afterwards? 1 Answer
Physics.simulate chews CPU but not using physics at all - Am I? 2 Answers