0 votes

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.

asked Nov 13, 2017 in Engine by mmarramarco (32 points)

1 Answer

+2 votes
Best answer

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

answered Nov 13, 2017 by cardoso (371 points)
selected Nov 13, 2017 by mmarramarco

that was F*CKING it.

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

Glad I could help :)

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.