Topic was automatically imported from the old Question2Answer platform.
Asked By
Ben Nicholl
I’m trying to programmatically create AnimationPlayer animation, with a property track and a frame property. My animation has 4 sprites, and the Animation looping is 2.7 seconds. My code is below, but it is not working.
The path needs to contain the property you want to animate as well:
var path = String(self.get_path()) + ":frame"
adding + “:frame” to my path variable doesn’t work
Ben Nicholl | 2020-05-22 13:13
Why not? Does it throw an error or warning? Of course the object the path refers to needs to have a property called frame - from the code you posted that’s not entirely clear, but I was under the assumption that it extends an AnimatedSprite.
njamster | 2020-05-22 14:12
This code is inside of a sprite, not an animated sprite. Normally if I use the AnimationPlayer node, I click on “add track”, which then allows me to select property track, then the node I will be animating, in this case a sprite, and then lastly, the property type, which is a frame.