I am attempting my first project with animatedsprites. I generally am putting scenes in a containing Node2D just to hold all of my subnodes. So, I have a "zombie" Node with a single child node that is an animatedsprite and holds 5 different animations.
I am using this code in the top level Node2D (zombie):
var state = 0 # 0 = not alive, 1 = appearing, 2 = walking, 3 = dieing, 4 = idle
var animator = self.get_child(1) # we will only have a single, animatedsprite
state = 1 # we are alive and should come out of the ground
if (state) == 1:
So my question is, when I assign the animatedsprite node in the "get_child" call at the top, how come the editor does not give me the methods on that type at the bottom? The line that says:
Is not recognized in the editor. I had to type that in and hope that it works. Am I doing something wrong? Should I be casting the 'animator' variable to an 'animatedsprite' type to get this to work?