@RogueWars Sorry to hear you're facing troubles. Your second image is almost accurate, just frame3
does not exist.
The problem is due to Unity's script update order. You seem to be calling skeletonAnimation.Skeleton.ScaleX *= -1
in e.g. an Update
or LateUpdate
call after the animation has been applied (and after callbacks UpdateLocal
,UpdateWorld
and UpdateComplete
are done), but before BoneFollower.LateUpdate
is called. This unfortunately leads to an incorrect state used by BoneFollower
component, where the skeleton.ScaleX
value is flipped but the bones are not yet updated accordingly (which happens in Bone.UpdateWorldTransform()
, called at the end of SkeletonAnimation.Update()
).
A solution would be to set Skeleton.ScaleX
in Update()
before any animation is applied by adding [DefaultExecutionOrder(-1)]
to your component that sets Skeleton.ScaleX
. This lets the script run before SkeletonAnimation
. Another solution would be to set ScaleX
after everything by calling it from LateUpdate()
and setting the component's execution order to [DefaultExecutionOrder(1)]
. In the second case you might be one frame late with your update however, so you might want to prefer the first solution.