AnimatedSprite can"t be played from parent

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By mmarramarco
:warning: Old Version Published before Godot 3 was released.

I am currently learning Godot, and I am more precisely learning how the animation process works in this engine.

My problem is : I succeed in making a script animate my character, but if I do the same thing from a parent, it doesn’t work.

So this work in my AnimatedSprite object :

extends AnimatedSprite

func _ready():
set_process(true)

func _process(delta):
	play("idle")

And if I do this in it’s parent, it doesn’t work and my player is static :

extends KinematicBody2D

onready var sprite = get_node("anim")

func _ready():
	set_fixed_process(true)

func _process(delta):
	sprite.play("idle")

I already check that every name are correct, I know the binding of the frame works (because the code at the top make my animation goes).
I just can’t get what I’am doing wrong, I am strongly suspecting the “get_node()” method. Before you ask, I alredy tried different path (such as the absolute path from the root).

Thanks for your time.

:bust_in_silhouette: Reply From: cardoso

Might be that you are using set_fixed_process(true) instead of set_process(true) on the _ready() func.

that was F*CKING it.

I don’t know how it ended up here, probably by auto completion. Thanks a lot.

mmarramarco | 2017-11-13 20:04

Glad I could help :slight_smile:

cardoso | 2017-11-13 22:25