@meanwhile See the documentation on script execution order here. Likely you're calling the code from Update()
and your component is executing after SkeletonGraphic
, being too late for this frame where the animations have already been applied to the skeleton. Thus the result of the SetAnimation
call is only visible the next frame.
If you want to reflect it immediately, call SkeletonGraphic.Update(0);
or SkeletonGraphic.ApplyAnimation()
.