• RuntimesGodot
  • How to use tracks in Godot

Hello guys, ⁣ I'm doing a boxing game in Godot with Spine and I don't know how to solve this problem. I'm now programming when the player gets hurt animation. The player has a tail attached to the head and when it dodges to the left or to the right the tail attachment changes. I created a get hurt animation that only changes the upper part of the player, and it works fine except the tail. You can watch it in the video for more explanation.

Related Discussions
...
  • Изменено

Your skeleton setup and your code look OK to me. Could you share a simple Godot scene with the front boxer assets? Maybe it's an issue in spine-cpp. But I need your assets to reproduce the issue.

Mario написал

Your skeleton setup and your code look OK to me. Could you share a simple Godot scene with the front boxer assets? Maybe it's an issue in spine-cpp. But I need your assets to reproduce the issue.

Hello Mario, where should I send it to you?

Hi maranpis, please send it to contact@esotericsoftware.com.

5 дней спустя
Luke написал

Hi maranpis, please send it to contact@esotericsoftware.com.

Ok, I've already sent it 😉


Hello guys 🙂

Any idea of what going on? I'm really intrigued

We received the project, thank you. We'll have a chance to check it out and get back to you on Monday. Sorry for the delay!

Sorry it took me a bit to get to this. I've imported your Zrono skeleton and atlas back into the Spine Editor, then used the Preview view to check what happens if I queue zrono_right_dodge on track 0, and zrono_get_hurt_right on track 1. Here‘s what the editor thinks should happen:

The runtime thinks the same. So this is not a bug in the runtime, but expected behaviour. Next, I had a look at the attachment timelines in the two animations. Here they are for zrono_right_dodge:

The PONNYTALE_IDLE5 attachment is attachment is disabled, the PONNY_TALE_BACK attachment is made visible. PONNY_TALE_BACK is the attachment we see in the screenshot above.

Here are the attachment timelines for the zrono_right_dodge animation:

The animation does not key any of the two tail slots at all. This means whatever is attached in the setup pose will be used if you play this animation on its own.

However, when you mix animations across tracks, and a lower track keys an attachment that's not set in a higher track, then the lower track attachment is used instead of the setup pose attachment of the higher track. And this is exactly what is happening here.

The solution is to add attachment keys to your animations that you mix with other animations. E.g. in zrono_get_hurt_right, I've keyed the PONNY_TALE_BACK slot to not have an attachment, and the PONNYTALE_IDLE slot to have the PONNYTALE_IDLE attachment attached. Here's the result when zrono_right_dodge is on track 0, and zrono_get_hurt_right is on track 1:

The solution is to add attachment keys to your animations that you mix with other animations. E.g. in zrono_get_hurt_right, I've keyed the PONNY_TALE_BACK slot to not have an attachment, and the PONNYTALE_IDLE slot to have the PONNYTALE_IDLE attachment attached. Here's the result when zrono_right_dodge is on track 0, and zrono_get_hurt_right is on track 1:

I can't see the image you have attached 🙂 maybe you can upload it again

The runtime thinks the same. So this is not a bug in the runtime, but expected behaviour. Next, I had a look at the attachment timelines in the two animations. Here they are for zrono_right_dodge:

As you can see in the video I have a right preview but then in the runtime works differently. I have made a video so you can see in detail what I'm doing.

9 месяцев спустя
Nate добавил(а) Godot тег .