#AnimationTree.set not working (error message)

18 messages · Page 1 of 1 (latest)

tardy cloud
#

Hi, very new beginner to Godot here. I'm following this tutorial https://www.youtube.com/watch?v=Luf2Kr5s3BM at 36:32, and in my Player script I try to use AnimationTree.set but I get an error, "Cannot call non-static function "set()" on the class "AnimationTree" directly. Make an instance instead."
What I did worked in the tutorial, but it was uploaded a year ago so things have probably changed since then. What does this error message mean exactly, and how can I fix it? Thanks in advance

This guide shows many changes to features like the tilemap tools, how to setup moving characters, and changes made to GDscript syntax in Godot 4 Alpha. The goal is to give a good overview of whats upcoming in Godot 4, since it's still currently in Alpha. Sprout lands assets and chapter timestamps below!

Sprout Lands Download ~ https://cupnooble...

▶ Play video
#

AnimationTree.set not working (error message)

graceful coyote
#

you need to do "animation_tree" because that's what you called the variable

tardy cloud
#

OH

#

thank you

#

like this?

graceful coyote
#

i guess, idk why it's null though

tardy cloud
#

hm

#

yeah idk

#

is @onready var animation_tree = $AnimationTree correct?

graceful coyote
#

it looks correct to me

#

acutally wait

#

the animation tree is a child of the animationpayer

#

so the path is wrong

#

it should be $AnimationPlayer/AnimationTree

tardy cloud
#

Ohhh

#

I think that worked!! Thank you so much