• Editor
  • Combining 2 skins with random placeholders

Hello everyone!

Every time I post in this blog is somehow related to skins and placeholders... It's the most hard to understand thing so far for me.

Ok, this is the situation:

I have an element with 2 different parts: The "base" (which is a musical note) and the "face" (which is a... face).
I have 3 types of each placed inside skin placeholders as follows:

Then, I created a skin for each part (Face and Note).

Now I want through Unith Runtime that both skins get combined (in order to have a note with face) selecting randomly between all three options in each skin. I tried to watch the "Mix and Match" videos but they cover so many options and variables that I get lost with so much information, I'm sorry.

Is this possible? Am I being clear with the explanation? I hope so!

Thank you very much in advance!

    Related Discussions
    ...

    Yimec I tried to watch the "Mix and Match" videos but they cover so many options and variables that I get lost with so much information, I'm sorry.

    Which videos do you mean by "the Mix and Match videos"? Please always share the relevant URLs so that we can understand your question better.

    Regarding combining skins, please check out the documentation:
    https://esotericsoftware.com/spine-unity#Combining-Skins
    Also check out the example scene Mix and Match Skins. You can find a video about the Mix and Match Skins example scene here:

    Thank you very much for your response, @Harald !

    I've been reviewing the documentation through all the links you provided and I achieved what I want, thank you!

    Now I have another related issue... or question. Is is possible to flip in runtime only one skin? I have been looking for an answer with no result, so I guess in advance it is not possible.

    Thank you all in advance for your responses!

    @Yimec Glad it helped.

    Is is possible to flip in runtime only one skin?

    What do you mean by that?

    @Harald

    What do you mean by that?

    As you can see in my previous post, I have 2 skins: Face and Note.
    In certain moments of my game I need to flip only the "Face" skin, keeping "Note" always the same.

    @Yimec Thanks for the clarification. Please note that you flip (scale X by -1) bones. Attachments are attached to these bones (via slots, which allow you to switch attachments). Skins are just sets of attachments. So you need flip the face bone, any attachments on face slots will be flipped with it, regardless which skin is currently active.

    What is the proper approach to achieve this in Unity?

    Please see the documentation here:
    https://esotericsoftware.com/spine-unity#Getting-and-Setting-Bone-Transforms-Manually
    You just need to get the desired Bone and then set bone.ScaleX accordingly. Note that you should not key the Scale X value of the same Bone in your animations then, otherwise you need to ensure that your code setting the flipped scale is set after your animations are applied every frame.

    You can use the SpineBone Attribute in your component to get a string property that lets you select a bone from a dropdown menu:
    [SpineBone]
    public string boneName;

      Harald Thank you very much for your detailed help!

      I will try to manage the situation with all the information you provided!

      Thank you again!