• RuntimesGodot
  • Godot get_animation_state() issue.

I'm trying to program some movement animations cause I've been having issues with the AnimationPlayer, but no matter what I do I keep getting this error or a similar one:
Invalid access to property or key 'animation' on a base object of type 'SpineTrackEntry'.

referring to this line:
if current_entry == null or current_entry.animation.name != new_animation:

I am unable to find the solution in the documentation so I would really appreciate any help.

  • Misaki đã trả lời bài viết này.
    Related Discussions
    ...

    AnonymousAd I think you need to use get_animation() and get_name() like this:

    current_animation = animation_state.get_current(0).get_animation().get_name()

    In GDScript, direct property access like animation.name may not always work as expected, especially when dealing with objects that use setter/getter methods internally.
    For more details on how properties and getters/setters work in GDScript, you may want to check this section of the documentation:
    https://docs.godotengine.org/en/stable/tutorials/scripting/gdscript/gdscript_basics.html#properties-setters-and-getters

    Our Godot runtime does not use properties but rather get_xxx and set_xxx methods. I might fix that down the line to allow for both.

    I've added an issue here:
    EsotericSoftware/spine-runtimes2742

    • Misaki đã thích điều này.