0

I have a problem where only one side of my animation is being colored. enter image description here

I am using the following code:

    teamCrowdNoneColor.skeleton.FindSlot ("torso").SetColor (teamNoneColor);
    teamCrowdNoneColor.skeleton.FindSlot ("sleeve").SetColor (teamNoneColor);

You can see from the below image there is no left or right for the sleeve, or arm. Any ideas on how I can fix this?

enter image description here

Tim Cooley
  • 749
  • 4
  • 19
  • 38

1 Answers1

1

The API does not seem to support this. Either have the skeleton data modified, so it has distinct slots for left and right, or access its fields directly:

foreach (Slot slot in teamCrowdNoneColor.skeleton.slots)
{
    if (slot.data.name == "sleeve")
        slot.SetColor(teamNoneColor);
}
Thomas Hilbert
  • 3,559
  • 2
  • 13
  • 33
  • Unfortunately that didn't work. We will have to rename the assets. I think that will fix it the best way. – Tim Cooley Jan 23 '16 at 20:37
  • 1
    What do you mean by "didn't work"? If you are more specific, someone might still find a solution. – Thomas Hilbert Jan 23 '16 at 21:05
  • It didn't work as in the results were the same as the images I posted above. There were no errors or any type of loge. The code worked great, as it didn't break the console, but it didn't do what we wanted. – Tim Cooley Jan 24 '16 at 19:14
  • If so, I guess this means that there really is only one slot called "sleeve". In this case, the problem will not be solvable using slots. As slots are the only model that supports definition of color, there is no solution other than having the skeleton data modified in a way that it provides distinct slots for left and right. – Thomas Hilbert Jan 24 '16 at 21:25
  • I figured it out. The image I showed earlier is for the atlases only. Which means there was only one. The slots were labeled sleeve_right and sleeve_left. – Tim Cooley Jan 25 '16 at 04:11