slallee Hi ! I am encoutering a bug when I try to combine a Skeleton Render Separator with a particule system in Unity 5. If I have only the particule system the display is fine. If I have only the render separator the display is fine too. But if I try to have both at the same time here is the kind of bugs I am getting: Basically the menu with the blue tube on the right has some particule system, and the yellow character is using a spine skeleton with a separator for the arms. Note that the graphic bugs only appears when I deploy on an Android device, on my PC in the editor it looks fine... Any idea or suggestion is welcome. Cheers, Stephane
Pharan So it runs fine on the PC and editor? And it works fine without the particles? But if you have the particles and the separated Spine animation at the same time, it glitches like this, only on the Android device? This is odd. spine-unity doesn't have any platform-specific code except for the loader in Windows UWP. This is likely a bug in Unity for Android that we need to work around. Which Unity version are you using? And are you using an IL2CPP build for Android?
slallee Yes, I confirm all your questions :-) I just tested again to build for windows and run outside of the editor and I have no problem. Only when deployed to an android device. I'm using Unity 5.3.0f4 and Mono2x as the scripting backend, so no IL2CPP...
slallee Yes it looks similar. Although in my case it completely scrambles the whole skeleton, while in your it seems to use de wrong texture in the wrong place... Was just reading your post... In your case do you have any mesh separator in your skeleton? Are you spawning particules in the scene?
Pharan I agree, I don't think it's the same problem. @stallee I want to have something for you to test but it won't be for another few hours. Please keep an eye on this thread. My current suspicion is that Unity for Android doesn't like it when mesh vertex or triangle buffers are too long.
Pharan Hey stallee. Go to your project and look for ArraysMeshGenerator.cs Open it and replace its code with the code here: https://gist.github.com/pharan/a7deef685d6bb2e5e9a3c4593ee9d709 It's not guaranteed to fix it, but it's the one thing I suspect might be causing problems in Android and not on desktop. I also wonder if more recent Unity patch releases fixes the problem.
slallee Hi Pharan, I just tried your script and the behavior is still the same. I'm now updating Unity in case... EDIT: After updating Unity to the latest version (and keeping your script too) the problem is fixed. Thanks a lot ! If you want to me test some more stuff I'd be happy to :-)
Pharan Oh, interesting. That's good news. Since the fix I sent above is slightly less efficient, you could also test using the official spine-unity without the fix. What happens with the above code is that every time you show or hide an attachment, it reallocates memory for new arrays with the exact required sizes for vertices/triangles. That's a pretty bad bug in Unity if it required that for dynamic meshes to work. This is has no effect if you don't often show/hide attachments or change draw order. And it only affects things that are separated by SkeletonRenderSeparator.