Hi
I have a project with multiple skins and with multiple slots There is one issue coming in my project that I am not able to find the Solution.

Explaining my project
Suppose my character's are having 20 hair style and all 20 hair style having separate slots, While exporting for unity I Off all hair style slots skin placeholder and then On that in unity under my game so it's kind of we can select any hair in game as a customization.

Problem
My Problem is when I select any hair and I switch on skin placeholder in the game it's working fine for most anims but for some animation it's flickering on some frame it's getting off.

I have checked in Spine many times but there is not key in Attachment but it's getting off in Unity on some frame maybe that is last frame of the anim.

Is there any Solution for this ! Thanks is advance.

Related Discussions
...

It sounds like the issue you're experiencing with the hair styles flickering in Unity might be related to how the animations are being applied or how the slots are being managed during runtime. Here are a few things you can check and try to resolve the issue:

  1. Check Animation Keys: Ensure that there are no hidden keys in your animations that might be affecting the visibility of the hair slots. Sometimes keys can be inadvertently set, causing unexpected behavior.

  2. Use SetSlotsToSetupPose: Before switching animations or skins, you can call skeletonAnimation.Skeleton.SetSlotsToSetupPose() to reset the slots to their setup pose. This can help ensure that no previous animation state is affecting the current one.

  3. Clear Tracks: If animations are not being mixed out properly, you might want to use AnimationState.ClearTracks() to clear any remaining animations on the tracks before playing a new one. This can prevent any leftover animation states from affecting the current animation.

  4. Check Skin Placeholder: Make sure that the skin placeholders are correctly set up and that the correct attachments are being used for each skin. You can also programmatically construct a skin at runtime if needed.

  5. Debugging: Add some debug logs to check which attachments are being set during the problematic frames. This might give you insight into whether the issue is with the animation or the runtime logic.

If these steps do not resolve the issue, it might be helpful to create a minimal Unity project that reproduces the problem and examine it more closely.

If you are changing skins, you probably want to call SetSlotsToSetupPose() afterward.

It's odd to use a slot per hair when only one can be visible at a time. It's better to use a single hair slot.

  • Shubh ha risposto a questo messaggio

    Nate

    So, you are saying that I can make all skin place holder in Single slot like all hair style in single slot ?

    Is there any limit for slots we have in Spine ?

    Thanks for replying !

    Yes. Make sure you read this:
    https://esotericsoftware.com/spine-slots

    Slots 1) group attachments of the same type, and 2) decouple bones from the draw order.

    There are no limits to the numbers of slots you can have.