0 votes

Hello everyone;

I'm here to ask a question,
For begin, i'm beginner... so don't judge me too harshly haha.

I follow a good Youtuber who "Make an action RPG in Godot 3.2" :
https://www.youtube.com/channel/UCrHQNOyU1q6BFEfkNq2CYMA

In the follow video, after creating few animation with "AnimationPlayer" like "RunRigh", "IdleRigt", "RunUp"...
He just set "animationPlayer" With $AnimationPlayer and after this, the line who do the animation is "animationPlayer.play("RunRight")
enter image description here

In my goDotproject, i have the same configuration as his:
// image2

But i really don't understand how doig the same thing at him. I am trying to search on Internet and on this forum, but i didn't found my answer.
enter image description here
(Sorry for my probably bad English)

Thank you in advance,
Xemnai

in Engine by (12 points)

1 Answer

0 votes

You need to cast to AnimationPlayer the node you are getting:

((AnimationPlayer)GetNode("AnimationPlayer")).Play("RunRight");

or

var ap = GetNode("AnimationPlayer") as AnimationPlayer;
ap.Play("RunRight");
by (996 points)

Thanks for your fast answer !

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.