- Home /
Animator.Initialize causes huge hitches in-game..preloadable?
It seems like Animator.Initialize loads the animation data when a prefab is instantiated or something. In any case, some huge processing happens when a prefab is first instantiated, NOT when the prefab is first loaded (via. Resource.Load or something). This is bad, since this means a gigantic one-time hitch when we first instantiate the object. We're making an open world game, so we'd like to async-load prefabs as we need them, and ideally the async-load would load everything including textures, animations, etc. But it seems like animations are not loaded at that time. is this true? What else could be the issue?
I have observed the same behavior. Did you manage to solve this issue?
Having the same issue. Are you using a pool system for the animated objects as well?
I've observed similar behavior -- it's really bad in the editor, not as bad in standalone builds (but for our animators on our high end dev machines it's a ~50ms hitch on the main thread.) I've filed a bug with Unity, and it's not up on issuetracker.unity3d.com yet, but I did mark it as public. Case ID is 771609.
Answer by JGriffith · Feb 04, 2015 at 03:19 PM
Looks like I was able to fix our problem.... The spawning code was using the pool manager to spawn it, but we were using a new prefab that was not put into the pool, so poolmanager was having to instantiate it at during game play. For some reason this was causing a 1000ms hiccup, where, for whatever reason, pre-loading it with the pool manager at game start does not cause the same issue.
Your answer