I am using Unity and am simply trying to get access to a specific bone of my skeleton. For whatever reason I keep getting the error "NullReferenceException: Object reference not set to an instance of an object" on my line of code "armBone = skeletonAnimation.skeleton.FindBone("gunBone");"
I am very confused because I'm doing exactly what was done with the spine boy example, and it that example compiles with no errors. I have named the bone I'm trying to find "gunBone" in Spine as well. What am I overlooking that is causing me this headache?
Thanks in advance.
using UnityEngine;
using System.Collections;
using Spine;
public class Script_Aimer : MonoBehaviour {
private int playerNumber;
public UILabel debugLabel;
private SkeletonAnimation skeletonAnimation;
private Bone armBone;
// Use this for initialization
void Start () {
skeletonAnimation = GetComponent<SkeletonAnimation>();
armBone = skeletonAnimation.skeleton.FindBone("gunBone");
}
}