Hi,
I am trying to create an attachment. Every thing works fine but setAttachment is not doing anything. It doesn't give any error also. It finds the slot and sets the attachment but i cant see it on my player.
Here is the code. I am instantiating prefab and setting skeleton data at run time.
GameObject playerGameObject = (GameObject)Instantiate (PlayerPrefab, Spawn.transform.position, Quaternion.identity);
string resourcePath = string.Format ("CharacterSkeletonData/{0}SkeletonData", characterName);
SkeletonDataAsset skeletonData = (SkeletonDataAsset)Resources.Load (resourcePath);
SkeletonAnimation skeletonAnim = playerGameObject.GetComponent<SkeletonAnimation> ();
skeletonAnim.skeletonDataAsset = skeletonData;
skeletonAnim.skeleton.SetAttachment ("Head", "Cap");
I tried setting attachment on already created game object with skeleton data but that also didn't work. Can anyone point me to right direction of how we can set an attachment in 2DToolKit?