xalbertus

Hello everyone,

with some Spine assets we have encountered some problems when flipping them in runtime. We have an animation for "turn", so the character does not just flip but turns smoothly. The problem is that We are setting the FlipX when the turn animation completes, but then it blinks for like 1 or 2 frames (sometimes even more). You can see the effect in the gif (the purple hand):

https://drive.google.com/file/d/1i8U_0TKpVMi8BRq1uzxZZvDr_U7yaWPh/view?usp=sharing

We use Playmaker to manage the animations, and we are not sure if maybe the problem is that it's too slow to perform the action or if it's a parameter that we are not keeping into account or what, so any help would be appreciated.

Thanks!
xalbertus
  • Mensajes: 17

Harald

I fail to see in the GIF what you described in text - even when playing back the GIF in slow motion (via https://ezgif.com/speed), I don't see the hand flickering. Please describe more exactly what you mean by flickering, or even better show it via drawn-over screenshots.

Is what you see related to the incorrect direction showing shortly as in the following thread?
Switch skeletons quickly
Avatar de Usuario
Harald

Harri
  • Mensajes: 4189

xalbertus

Hey Harald, thanks for the response!

Sorry, the other gif was rendered at 15fps and I didn't notice. Here you have another gif where you can appreciate the effect better:

https://drive.google.com/file/d/1i8U_0TKpVMi8BRq1uzxZZvDr_U7yaWPh/view?usp=sharing

I don't think the issue is the same as the thread you posted, but I can't be sure.
xalbertus
  • Mensajes: 17

Harald

xalbertus escribió:Sorry, the other gif was rendered at 15fps and I didn't notice.
8)

Thanks for uploading the new GIF, I can now see what you mean. Since it's happening a few frames after switching directions, I'm afraid it's some other problem.

Which version of Spine and which version of the spine-unity runtime package (name of the unitypackage) are you using?
Avatar de Usuario
Harald

Harri
  • Mensajes: 4189

xalbertus

Harald escribió:
xalbertus escribió:Sorry, the other gif was rendered at 15fps and I didn't notice.
8)

Thanks for uploading the new GIF, I can now see what you mean. Since it's happening a few frames after switching directions, I'm afraid it's some other problem.

Which version of Spine and which version of the spine-unity runtime package (name of the unitypackage) are you using?
Hi again,

We use the latest Spine Editor (3.8.97) and the latest Spine Unity plugin (spine-unity-3.8-2020-06-25). Also we use Unity2020.2.0a15.1993

Also we use Playmaker 1.9.0.p15
xalbertus
  • Mensajes: 17

Harald

Thanks for the info. Could you then please send us a minimal reproduction Unity project that still shows the problem, as a zip package to contact@esotericsoftware.com? Then we can have a look at what's going wrong.
Avatar de Usuario
Harald

Harri
  • Mensajes: 4189

xalbertus

Harald escribió:Thanks for the info. Could you then please send us a minimal reproduction Unity project that still shows the problem, as a zip package to contact@esotericsoftware.com? Then we can have a look at what's going wrong.
I just sent an email to you with a sample project. Waiting for your response :)
xalbertus
  • Mensajes: 17

Harald

Thanks for the package, we will have a look at it and get back to you as soon as we've figured out what's going wrong.

---

The problem is that the Complete event is issued in the last frame of the animation during the skeletonAnimation.Update() call, however immediately in the same (last animation) frame the Flip state is entered and the skeleton is flipped to early, before the last animation frame's LateUpdate().

So the solution is to wait for one frame after Complete and then flip.
Avatar de Usuario
Harald

Harri
  • Mensajes: 4189

xalbertus

Wow thanks a lot, apparently that fixed the issue :D !
xalbertus
  • Mensajes: 17

Harald

You're welcome! 8)
Avatar de Usuario
Harald

Harri
  • Mensajes: 4189


Volver a Unity