- 수정됨
SkeletonAnimation.UpdateLocal seems to have stopped working
Hi there!
I use SkeletonAnimation.UpdateLocal to position a shadow at a particular angle, no matter the rotation of my sprite. This is done as follows:
void SetUpdateLocal() {
SkeletonAnimation.UpdateLocal += UpdateShadowPositions;
}
void UpdateShadowPositions(ISkeletonAnimation animated) {
float rotation = transform.eulerAngles.z;
_shadowBone.Rotation = -rotation;
_shadowDeadBone.Rotation = -rotation;
}
However this seems to have stopped working. Eventually the shadow is repositioned correctly, but it is not done each frame, rather after 1 second or so. The only thing I can see that would have affected it is updating to the latest version of the Spine runtimes. I don't suppose this was changed in some way?
I tried changing to UpdateWorld, but it still does not update each frame, instead updating after 1 second. I believe the Spine object might be static at this time (not playing any animation, just looping idle), would this have anything to do with it?
Thanks!
According to the runtime git history, the part of the code that handles UpdateLocal hasn't changed in at least two years.
Nothing's wrong with the code you posted.
But if you added SkeletonUtility to your GameObject recently, and included that bone, it's probably overwriting your changes.
Beyond that hunch, I'm not sure.
Thanks for the reply!
The only major change I made was using a SkeletonPartsRenderer to split up my Spine object. Could that be impacting it somehow?
You could find out. Did you try disabling the SkeletonRenderSeparator and checking if it's still broken?
As you will no doubt be surprised to hear ( ), it turns out I had a delay in another part of my code that was stopping from being called immediately. My apologies!
No worries! I'm glad you found the problem though!