Exis

Hello!
We are using Spine, and it looks great. But - when we instantiate our prefabs with spine animation attached on it, Unity freezes for several seconds, and then we see lots of work and 100+ MB garbage. Could you please tell us what's wrong - does our spines are bad, or maybe there is some settings to remove this lag?

On the screenshot - example with instatiaton of one Spine asset from resources folder in empty scene.
Bạn không được cấp phép để xem tập tin đính kèm trong bài viết này.
Exis
  • Bài viết: 1

Harald

Did you export the skeleton as .json or binary .skel.bytes file? Please note that .json loading at runtime will lead to much more GC load than the same skeleton exported as binary .skel.bytes file.

Also, as is typical Unity best-practice (with any game engine actually): please consider creating pools of your objects instead of instantiating and destroying them. You can then pre-warm the pools with a suitable number of objects at level-load time to not have any hiccups during actual play time, if that is possible.
Hình đại diện của thành viên
Harald

Harri
  • Bài viết: 1951


Quay về Unity