Hi there, this has got me a little stumped, and I'd just like to know what I was doing wrong.
I'm attempting to set the frame of a sprite animation (Big surprise, I know
), but try as I might, I can't seem to get the actual sprite in-game to change it's frame.
Here's what I've written:
void Start ()
{
// get the sprite component
sprite = GetComponent<tk2dAnimatedSprite>();
sprite.SetFrame(50);
}
It just never seems to update, and I can't fathom why.
I should also mention this is being placed as a component on a button. Should that cause any issue? Oh, and I'd also note that actually changing the animation clip seems to work fine, and it is set to not play as default.
Am I missing something really obvious?