While playing spine animations in unity on every loop setup pose shows up. which looks jerky is there a way to avoid setup pose in unity while playing animation on loop?
Thanks in advance.
jerk in unity while playing spine animation on loop
To avoid the jerky appearance caused by the setup pose showing up at the start of each loop when playing Spine animations in Unity, ensure that your animations are correctly set up to loop without reverting to the setup pose at the end. This issue might be related to how the animations are queued or mixed. Here are a few suggestions based on the provided contexts:
Check Animation Settings: Ensure that your animations are set to loop correctly in Spine and that this setting is correctly imported into Unity. Animations not set to loop might revert to the setup pose at the end of each playthrough.
Use AnimationState and TrackEntry: Utilize the
AnimationState
andTrackEntry
classes to control the playback of your animations. For looping animations, you can set the loop property on theTrackEntry
returned byAnimationState.SetAnimation
orAnimationState.AddAnimation
. For example:var trackEntry = skeletonAnimation.state.SetAnimation(0, "animationName", true); trackEntry.loop = true;
This ensures that the animation loops without reverting to the setup pose.
Avoid Resetting the Animation Unnecessarily: If you're manually controlling the animation playback, ensure you're not unintentionally resetting the animation state or skeleton to the setup pose between loops.
Check for Animation Mixing Issues: If you're using animation mixing (blending animations together), ensure the mix durations and settings are correctly configured to prevent the setup pose from appearing during transitions. Incorrect mixing can cause a brief appearance of the setup pose.
Update to the Latest Spine-Unity Runtime: Ensure you're using the latest version of the Spine-Unity runtime, as performance improvements and bug fixes are regularly made that could address your issue.
If these suggestions do not resolve the issue, it might be helpful to review the specific setup of your animations in Spine and how they're being implemented in Unity to identify any configuration or coding issues.
@ParimalDubewar In other words, if you briefly see the setup pose when you want to play a looping animation, your code is wrong. How are you setting the looped animation? Do you perhaps have game code which checks your current state and set animations accordingly? If so, please check whether this code sets the looping animation only once (and not e.g. every frame).
Harald Thanks I will check this.
If so, please check whether this code sets the looping animation only once (and not e.g. every frame).
@ParimalDubewar I just noticed that my above sentence was ambiguous, so for more clarity:
The animation should be set only once with trackEntry.loop
set to true
. You will run into problems when your game logic code sets animations each frame.
@ParimalDubewar Reading your other posting on this thread would explain why you see the setup pose when an animation loop completes. Please check your logic for when the static image is displayed, very likely something is wrong there.