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.

in Engine by (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.

by (384 points)
selected by

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.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.