• Bugs
  • Culling mode bug

  • تم التحرير
Related Discussions
...

Dear developers,

I have encountered a bug when I try to turn my character, where the character will disappear for a fraction of a second then reappear.
I have included the a detail description using spineboy to recreate the bug. It is image heavy please find the attached document at Onedrive https://1drv.ms/w/s!Ahkq2MlrCJw-cn-BaE_hoSCp7HY (since forum don't allow me to attach ms doc).

It would be appreciated if you can help pinpointing the problem (or let me know how to achieve the animation effect).
Thank you very much for your assistance
I look forward to your reply

Thank you for your detailled writeup.
In general it would be much easier to follow the discussion if you post the text and images here on the forum, instead of attaching a link to a word document.
Also, when showing code, please do not make a screenshot of it, but post it in text form (the forum offers code formatting for this reason), so that in case anyone wants to replicate the behaviour, she can copy and paste it easily.

Now regarding your problem:

I need to alter the “_Cull” parameter in the Material.shader according to the direction the character is facing (left or right).
[..]
My character is in 2.5D and I cannot use the Cuffoff method, as it will cause the image to display incorrectly. I can only use the CullFront/CullBack method.

Why can't you disable culling?

Regarding setting material properties on a single object instance, it is recommended to use MaterialPropertyBlocks instead.
You can have a look at the spine-unity documentation section here:
spine-unity Runtime Documentation: Changing Materials Per Instance

How do you rotate or flip the character around?
Please note: If you only need to flip the character from left to right, then the simple way in the Spine runtimes is to set skeleton.ScaleX to -1. If you really need a rotation animation around the vertical axis, then the scale solution will of course not be sufficient.

8 أيام لاحقا

Thank you very much for your solution.
Somehow the image still disappears for like a frame, but it’s happening right at middle of the turn when the image flips(it was at the animation switch before). It’s unnoticeable unless I play frame by frame.

Why can't you disable culling?

Because the programmer said so.
And my fault not questioning it

I’m gonna write the codes myself.

We would also definitely recommend disabling culling in your case.

In general, disabling culling can have a negative performance impact on real 3D meshes. However in your case, disabling it on a flat 2D character, you will not suffer from any performance penalty, as there are no hidden backfaces anyway. You would just be hiding those that you actually would like to see.