Topic was automatically imported from the old Question2Answer platform.
Asked By
Yamarin
Hello!
I’m trying to get though tutorial - 2D game on official site
I’m stuck at this step:
First, we get the list of animation names from the AnimatedSprite2D's frames property. This returns an Array containing all three animation names: ["walk", "swim", "fly"]
So my problem is that it doesn’t suggest get_sprite_frames() on a dropdown list when I type. It’s just not there. I have no idea what I’m doing wrong. The only idea is that it’s about version - I’m using 4.0. Documentation should be up-to-date, but maybe it’s not?
Hmmm… Looks like a lot of the node property setter/getter functions are no longer offered by the code hinting system. I assume that was a conscious decision (perhaps on the way to deprecation?) but I’m not really sure.
A few things. First get_sprite_frames() should still work if you just add it to your code (without the hint). Also, it’s just the getter for the sprite_frames property, which you could use instead (and will get code hints for that).
It works, actually!
Thank you.
I saw sprite_frames on the list, but I don’t know how to use it instead, sadly.
Yamarin | 2023-03-20 21:40
Great - glad it works. And, for reference, the above code using direct property access (so, without the getter), would look like: