wightwhale

I'm new to spine so maybe there's something obvious I'm missing but here's what I've done so far.

SkeletonAnimation anim;
anim = GetComponent<SkeletonAnimation>();
anim.state.SetAnimation( 0, "Hit", false );




My issue is that anim is always null even though it clearly exists in the inspector.
wightwhale
  • Сообщения: 5

wightwhale

I would also like to add that I'm able to get the component on the main character in my game but not on the hammer object, and from what I can tell there's no warnings.
wightwhale
  • Сообщения: 5

Pharan

Is this code by any chance in Awake or Start?
Аватара пользователя
Pharan
  • Сообщения: 5366

wightwhale

It was my fault I had an old game object with the same name linked in the code as versus the new game object. Works great now thanks.
wightwhale
  • Сообщения: 5


Вернуться в Runtimes