rayxuln / spine-runtime-for-godot

This project is a module for godot that allows it to load/play Spine skeleton animation.
MIT License
93 stars 22 forks source link

[Troubleshooting Help] Unable to get AnimationTree to work #14

Closed jonchun closed 4 years ago

jonchun commented 4 years ago

godot.zip

Sorry that the code is a bit of a mess -- I was porting some old code I have from other projects and trying to integrate the Spine runtime.

Everything we care about happens in Character/Player/Player.tscn

I've created a "wrapper" called CharacterSkin which is going to be my own Skinning for my characters separate from Spine.

With that stated, on to my problem: I've created an AnimationTree and an AnimationPlayer similarly to the examples. I currently have 2 animation states, idle and walk.

In _physics_process, I try doing:

    if true:
        anim_playback.travel("walk")
    else:
        anim_playback.travel("idle")

which is the same as what the example has (constantly travels to one of the animation nodes every frame)

However, my animation partially plays once and then stops/freezes. For some reason, if I go into the Remote tab in my scene and uncheck active on the AnimationTree node, it starts animating fine. I have no idea why it works in the example but not in mine.

I have no idea if this is a bug with this spine-runtime port or if I'm doing something silly which is why I'm posting here for help.

rayxuln commented 4 years ago

image

You should set the track update mode in the animation player to discrete, otherwise it will set the current_animations all the time which will call set_animation function all the time and this function is supposed to be called once if you want to play a animation.

godot.zip

jonchun commented 4 years ago

That was exactly it. Thank you.