Hello,
I am trying to recieve the currentClip name but i have problems doing so:
public static void playClip(tk2dSpriteAnimator animator, string clipName)
{
//check if the clip exists
if(animator.GetClipByName(clipName) != null)
{
//THIS PART RAISES ERROR: Object no set to an instance of an object
print (animator.CurrentClip.name);
print ("AnimHelper: Now playing clip " + clipName);
animator.Play(clipName);
} else
{
print ("AnimHelper: ATTENTION.... clip " + clipName + " does not exist for GameObject " + animator.gameObject.name);
}
}
But if i comment out the line with "CurrentClip" i don't get the error: "Object not set to an instance of an Object"
Thanks for your help